print the number of occurences of not `none` in a list `lst` in Python 2,print(len([x for x in lst if x is not None]))