Count Not None

Sum

sum(x is not None for x in lst)

References

[1] Hrabal@StackOverflow, How to count the number of occurences of None in a list?

[2] acs@StackOverflow, Counting the number of True Booleans in a Python List

results matching ""

    No results matching ""