Solved! Go to Solution.
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 >>>
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 >>>