+ 1

i = 1 while i <= 5: print (i) I = i+1 difference i = 1 ........ i = i+1 print (i)

4th Apr 2019, 4:30 AM
Anonymous
Anonymous - avatar
3 Antworten
+ 6
M. Watney Yup, I really missed that part. Thx for pointing
4th Apr 2019, 4:50 AM
Arushi Singhania
Arushi Singhania - avatar
+ 5
So, u have two diff cases. Case 1 : I = 1 while I <= 5 : print (I) I = I + 1 Case 2 : I = 1 I = I + 1 print (I) In 1st case , Nothing will be printed as I is smaller than 5. In 2nd case, 2 will be printed.
4th Apr 2019, 4:38 AM
Arushi Singhania
Arushi Singhania - avatar
+ 2
Arushi Singhania I guess you missed something. In case 1, the statement i= i+1 should be indented and it'll print 1 2 3 4 5 As condition for while i.e. i<=5 will be true for i=1 to i=5.
4th Apr 2019, 4:45 AM
Шащи Ранжан
Шащи Ранжан - avatar