思路:
- 设定函数满足题目中的巴拉啦魔法
- while 循环 对数字进行巴拉啦魔法,知道数字是个位数
def mmm(x):
return sum([int(x) for x in str(x)])
x=input()
while len(str(x))>1:
x=mmm(x)
print(x)
def mmm(x):
return sum([int(x) for x in str(x)])
x=input()
while len(str(x))>1:
x=mmm(x)
print(x)