Advertisement
Anastasiiauser

Untitled

Dec 6th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. def s(a):
  2.     result = 0
  3.     while a > 0:
  4.         result += a % 10
  5.         a //= 10
  6.     return result
  7. print(s(997))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement