I've been following an online course and I've ran into a road block. I wanted to try to see if a list of integers is greater than one given integer. I keep getting the error TypeError: '>=' not supported between instances of 'list' and 'int'. Help?
Here's my attempt:
def numCount(someList, comparison):
returnVal = []
if numList >= comparison:
returnVal += numList
return returnVal
numList=[0, 2, 4, 5, 10]
print(numCount(someList, 9))
numListis a list right now, andcomparisonis an int - do you know how to get an int out of the listnumList?print(numCount(numList, 9))andif someList >= comparison:. Note: You can do this withfilter(), e.g.return list(filter(lambda x: x >= comparison, someList))