Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = input()
- while True:
- result = 0
- for digit in str(n):
- if digit.isalnum():
- result += int(digit)
- n = result
- if n <= 9:
- break
- print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement