whdans


SUBMITTED BY: rlawhdans

DATE: April 21, 2016, 12:20 p.m.

FORMAT: Text only

SIZE: 145 Bytes

HITS: 883

  1. # find sum of digits
  2. n = input("enter an integer : ")
  3. total = 0
  4. for i in n : # string is iterable
  5. # print(i)
  6. total += int(i)
  7. print(total)

comments powered by Disqus