guys. 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 TypeError: '>=' not supported between instances of 'list' and 'int'. Help?
Here's my attempt:
def numCount(someList, comparison):
returnVal = 
if numList >= comparison:
returnVal += numList
numList=[0, 2, 4, 5, 10]
You must iterate over each item in the list and compare them:
def numCount(someList, comparison): returnVal =  for elt in someList: if elt >= comparison: returnVal.append(elt) return returnVal numList=[0, 2, 4, 5, 10] print(numCount(numList, 9))
The output is a list of the values in
numListthat are greater or equal to the comparison integer.