1.
num = 1010
def test(n):
res = 0
for index, value in enumerate(str(n)[::-1]):
res += int(value) * 3**index
return res
print(test(num))
参考:
[https://zhidao.baidu.com/question/95815854.html](https://zhidao.baidu.com/question/95815854.html)
网友评论