for i in range(10): #特殊写法,从0开始,步长为1,最大值小于10 print("loop",i)print("=========")for i in range(3,9,2): #从3开始,步长为2,最大值小于9 print("loop",i)#在python命令行执行,结果是[0,2,4,6,8,10,12,15,16,18]:[ i*2 for i in range(10) ]