World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITian's, only for AI Learners.
for i in range(1,11): print(i) i=i+1
in the for loop i have added an updation for variable 'i' inside the loop instead of giving step size as 2. But the value of 'i' doesnt get updated.why its so??
yes. its get updated while using range function with step size 1.Bt i have given another updation for the same variable 'i' inside the loop.ie first value of i is 1 and it gets printed,next inside the loop the same variable is updated ie 2.and nextly it should get updated using range function ryt??