用Python写游戏,飞机大战
>>> x,y = 4,5
>>> small = x if x < y else y //三元操作符
>>> small
4
>>
>>> range(5)
range(0, 5)
>>> list(range(5))
[0, 1, 2, 3, 4]
>>> for i in range(5):
print(i)
0
1
2
3
4
>>> for i in range(2,9):
print(i)
2
3
4
5
6
7
8
>>> for i in range(1,10,2):
print(i)
1
3
5
7
9