+ 1
When i changed i=i+1 to i+=i,the output also changed into 1,2,3,4,finished....previously output was 1,2,3,4,5,finished.why?
i = 1 while i <=5: print(i) i += i print("Finished!")
2 odpowiedzi
+ 4
i=i+1 is same as i+=1
And different to
i+=i which is i+=i
the output was 1,2,4 ?
0
Yep