Answers for "list count none python"

1

count none in list python

lst = ['hey','what',0,False,None,14]
print(sum(x is not None for x in lst))
Posted by: Guest on April-18-2021
0

count none in list python

len(lst) - lst.count(None)
Posted by: Guest on April-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language