标题: Amazing [打印本页] 作者: 474071450 时间: 2019-6-21 17:22 标题: Amazing def n(a):
l1 = [a,]
for a in l1:
b = a // 2
l1.append(b)
if b == 1:
break
print(l1)
l2 = []
for c in l1:
d = c % 2
l2.append(d)
print(l2)
sum = 0
for index,e in enumerate(l2):
sum += e*(2**index)
print(sum)