hdarwin

cstutoringcenter.com_Sum of digits

Dec 28th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.09 KB | None | 0 0
  1. #!/usr/bin/env python
  2. sum = 0
  3. for x in list(str(2 ** 50)):
  4.     sum = sum + int(x,10)
  5. print sum
Advertisement
Add Comment
Please, Sign In to add comment