What statement in Python has the exactly same function as do statement in SAS -


what statement in python has same function do statement in sas? or how can translate following sas code python language? thanks

do = 1 nreach ;      rchld[i,] = incddsrc[i,]+carryf[i,]#node[data[i,jfnode],] ; 

here simplified sas statement support site:

if years>5    do;       months=years*12;    end;    else yrsleft=5-years; 

here code nested in do/end execute if var years greater 5. if not executes else statement.

in python this:

if years > 5:     months = years * 12 else:     yrsleft = 5 - years 

the indentation enough because python awesome! believe looking python loop. statement:

do i=1 nreach;     here 

in python looks this:

for in range(1,nreach):     print 

range returns list of values 1 until nreach. note indentation.

best regards