It is because the built-in function range
only takes integers. You can use numpy like so:
for theta in np.arange(np.pi/24, np.pi/2, np.pi/24):
''' Do your stuff here '''
Remember that the stop value is excluded from the range, so if you want to include that in your calculation, then you will have to add np.pi/24
to your stop value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…