Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = input()
- def sum_from_string(N):
- """Returns sum of numbers in a string"""
- return sum([int(i) for i in N if i not in "-."])
- N = str(sum_from_string(N))
- while(int(N)>9):
- N = str(sum_from_string(N))
- print(N)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement