Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count None in list

"""Counting the number of None in list
"""
lst = [False, 0.982, None, "lol", True, None, 90]

count_1 = lst.count(None)
count_2 = sum(_ is None for _ in lst)

print(count_1)
print(count_2)
## 2

Check out the source for more info!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #None #list
ADD COMMENT
Topic
Name
4+4 =