不是说for循环需要整数,是因为你的range里的step不能是小数
import numpy for i in numpy.arange(1, 16, 1.5): print(i)
for循环中step一定要为整数的,step为小数可以自己写个while循环