def trial(f1,f2): list = [f1,f2] l1 = len([i for i in list if i is not None]) return l1
def trial(theList): l1 = len([i for i in theList if i is not None]) return l1
>>> print list # a predefined list [0, None, 3] >>> >>> trial(list) 2 >>>
>>> print f1, f2 0 None >>> def trial(f1, f2): list = [f1, f2] l1 = len(filter(lambda x: x>=0, list)) return l1 >>> trial(f1, f2) 1 >>>
>>> print f1, f2 0 None >>> def trial(f1, f2): list = [f1, f2] l1 = len(filter(lambda x: x is not None, list)) return l1 >>> trial(f1, f2) 1 >>>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.