0
What os the use of i = i+1 in this code?
2 Answers
+ 13
It increments (increases) the value of i by 1
when i =1
i= 1+1=> i=2 #new i value
i=2+1=> i=3 #new i value
This continues till i < =5
when i becomes 6 the while loop stops and prints Finished
0
i += 1 works also in place of i = i + 1.
i += 1 increments the value of i by 1 and assigns the new value to i.