Give a method that sums all the numbers in a list. The method should be able to skip elements that are not numbers. So, sum([1, 2, 3]) should be
list
sum([1, 2, 3])
def foo(list): dict= "ABCDEFGHIJKLMN" n=0 for i in range(0,len(list)-1): if str(list[i]) in dict: "" else: n= n+list[i] return n print foo([1,2,3,4,5,6,"A","B"])