Advertisement
daniil-vlasenko

8.2

Jul 24th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. def sum_of_digit(a):
  2. res = 0
  3. while a:
  4. res += a % 10
  5. a = a // 10
  6.  
  7. return res
  8. a = int(input())
  9. print(sum_of_digit(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement