# This program takes a list of non -ve integers and # returns a lsit of the sum of digits of each element # of the input list. def digSum(n): sum = 0 while n > 0: sum = sum + n%10 n = n/10 return sum def sumLst(l): if l == []: return [] return [digSum(l[0])] + sumLst(l[1:]) def main(): l = input("Enter the list: ") print "LstSumOElmOfLst(", l,") =", sumLst(l) main()