Advertisement
SomeBody_Aplle

Untitled

Jan 3rd, 2022
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. def recurs(value):
  2.     value = str(value)
  3.     lst = list(map(lambda x: x[::1], value))
  4.     res = sum([int(i) for i in lst])
  5.     while not res % 10 == res:
  6.         res = str(res)
  7.         lst = list(map(lambda x: x[::1], res))
  8.         res = sum([int(i) for i in lst])
  9.     return res
  10.  
  11.  
  12. print(recurs(132189))
  13. print(recurs(493193))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement