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 >>>
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.