python fastest way to count none in list code example
Example 1: count none in list python
lst = ['hey','what',0,False,None,14]
print(sum(x is not None for x in lst))
Example 2: count none in list python
len(lst) - lst.count(None)
lst = ['hey','what',0,False,None,14]
print(sum(x is not None for x in lst))
len(lst) - lst.count(None)