euler/e016.py

8 lines
125 B
Python
Raw Normal View History

n = 2**1000
s = str(n)
total = 0
for c in s:
total = total + int(c)
print 'Sum of digits for {0}: {1}'.format(n, total)