Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
whdans
SUBMITTED BY:
rlawhdans
DATE:
April 21, 2016, 12:20 p.m.
FORMAT:
Text only
SIZE:
145 Bytes
Raw
Download
Tweet
HITS:
883
Go to comments
Report
# 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)
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus