Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find number of x greater than threshold in list python

>>> j = [4, 5, 6, 7, 1, 3, 7, 5]
>>> len([1 for i in j if i > 5])

# OR
>>> sum(1 for i in j if i > 5)
 
PREVIOUS NEXT
Tagged: #find #number #greater #threshold #list #python
ADD COMMENT
Topic
Name
1+5 =