打印列表元素
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(numbers)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
打印列表元素 python3...numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(*numbers)
0 1 2 3 4 5 6 7 8 9
打印列表元素 python2
numbers...2, 3, 4, 5, 6, 7, 8, 9]
for number in numbers: print(number)
0
1
2
3
4
5
6
7
8
9
列表元素扩大2倍(使用列表推导式 list...)
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
列表逆序 反向1
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
reverse = list...(z2)
[(1, 2, 3), ('a', 'b', 'c')]
列表拼接字符串
string = ['Python', 'is', 'YYDS']
' '.join(string)
'Python