I was wondering if someone can help me with a homework problem.
Write a function, func(a,x), that takes an array, a, x being both numbers, and returns an array containing only the values of a that are greater than or equal to x
I have
def threshold(a,x):
for i in a:
if i>x: print i
But this is the wrong method as I’m not returning it as an array. Can someone hint me the right direction. Thanks a lot in advance
use the in-built function
filter():