今天遇到一小问题:pythonfor循环步长为小数
‘TypeError: range() integer end argument expected, got float.’
python中的for循环如何控制步长 :
for i in range(1, min0, max0):
解决方案:
import numpy as np
list = np.arange(min0, max0, 0.01)
# print list
for item in list:
print round(item,2)