0

what is difference between

i=1 while i<=4 j=1 k=i=m while j<=k print(m) m=m+1 j=j+1 print i=i+1 and i=1 while i<=4 j=1 k=i while j<=k print(m) k=k+1 j=j+1 print i=i+1

11th Jul 2017, 11:27 AM
Amrish Mishra
Amrish Mishra - avatar
2 Answers
+ 1
You should avoid to use such assignments 'k=i=m'. And 'm' is not defined. The first example needs a value for 'm' to work. In the second example your inner loop is infinite.
11th Jul 2017, 12:20 PM
Boris Batinkov
Boris Batinkov - avatar
+ 2
Your first loop has more errors. M isn't defined. your missing : in 4 places. Your loops are infinite.
11th Jul 2017, 12:02 PM
LordHill
LordHill - avatar