for循环格式: for index in range(0,3):#等同于range(3),取0\1\2 print(index) index = 0 starnames = ['xr1','xr2','xr3'] for index in range(len(starnames)): print(starnames[index]) 结果: xr1xr2xr3 range函数: range(1,5) 取1-4 range(1,5,2) 取1-4,1是起始下标,5是终止下标,步长为2 range(…