# find sum of digits n = input("enter an integer : ") total = 0 for i in n : # string is iterable # print(i) total += int(i) print(total)