+ 1
When i turned it from i=i+1 into i+=i+1..its showing output 1,3,finished..previously output was 1,2,3,4,5,finished..why?
i = 1 while i <=5: print(i) i += i + 1 print("Finished!")
4 Réponses
+ 2
Because i=i+1 in short is writen by i+=1 not as you had writen i+=i+1
i+=i+1 simply means i=i+i+1
0
Why i+i+1 results 1,3