x = range(1, 10, 2) # range(start, stop, step) 其中[start, stop)左闭右开,step是步长
for i in x: # x是可迭代对象(暂且理解为列表也行)
print(i, end=' ') # 输出结果 1 3 5 7 9
x = range(10) # stop=10,start默认为0,step默认为1
for i in x:
print(i, end='') # 输出结果 0123456789
x = range(4, 9) # start=4,stop=9,step默认为1
for i in x:
print(i, end=' ') # 输出结果 4 5 6 7 8