赞
踩
a = [1, 2, 3, 4, 5]
print(a)
l = len(a)
for i in range(0, l):
print(a[l-i-1])
输出:
[1, 2, 3, 4, 5]
5
4
3
2
1
a = int(input('please input a number:'))
b = 0
while a > 0:
b = a % 10
a = a // 10
print(a, b)
输出:
please input a number:12345
1234 5
123 4
12 3
1 2
0 1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。