# This program has two functions, non-recursive and recursive, that # takes a list of numbers as parameters and returns the sum of # these numbers. def lstSumI(l): sum = 0 for elm in l: sum = sum + elm return sum def lstSumR(l): if l == []: return 0 return l[0] + lstSumR(l[1:]) def main(): l = input("Enter the list: ") print "SumOElm(", l,") =", lstSumI(l) print "SumOElm(", l,") =", lstSumR(l) main()