逆序输出数字
输入1,2,3,输出321的3种方法: ①
a
=list('123')
print(a
)
a
.reverse
()
print("".join
(a
))
②
b
=123
c
=b
//100
d
=b
%100//10
e
=b
%100%10//1
print(c
)
print(d
)
print(e
)
print(e
*100+d
*10+c
)
③
for x
in range(100,1000):
g
=x
//100
h
=x
%100//10
k
=x
%10
if(x
==g
**3+h
**3+k
**3):
print(g
)
print(h
)
print(k
)
print(x
)
转载请注明原文地址:https://blackberry.8miu.com/read-34047.html