I want to run the for loop from 0 to 64 with step size of 0.05. If I use the range function it gives a Typeerror. My code
for i in range(0,64,2):
P=0+i
Q=2+i
for s in range(P,Q,0.05):
X=s
I am actually converting a FORTRAN code into python and in that code, 0.05 was usesd as the step size. The code:
DO 20 I =0,64,2
P=0+i
Q=2+i
DO 10 s=P,Q,0.05
X=s
IF((X.GE.P).AND.(X.LT.(P+Q/2))) THEN
Y = -1
ELSEIF (X.GE.(P+Q/2).AND.(X.LT.Q))
Y=1
ENDIF
WRITE(*,*)y
Please help me how can I convert this code properly into python. Edit: Please check the rest of the code and I dont understand what this ENDIF statement does.