0
can any body help?
can any body explain this code? m=0 for x in range(1,4): for y in range(1,3): m=m+1 print (m)
2 Answers
+ 3
Three times, do this twice: add m to itself + 1 then after all that, print m.
+ 1
range(1,4) is 1,2,3
range(1,3) is 1,2
So m is increased by 1 for 6 times (3*2)
Values of x and y are not used, but they are
x, y
1, 1
1, 2
2, 1
2, 2
3, 1
3, 2