+ 2
Pls explain it
I written a code in python But something is different I dont know how the result is coming Pls help https://code.sololearn.com/c2nDI79Nnvgj/?ref=app
3 Answers
+ 4
Nice question
+ 3
For r in range (10) print r which is 0 then print r which now 2 so 0 2 then it starts again from the beginning print r which is 1 now the print r which is 2 so 0 2 1 2 and so on....
It's like with each r you print print 2 next to it
+ 2
For loop prints from 0 to 9 and r=2 is executed every time for every single loop. So you get-
0212223242...See how that 2 is coming after every digit from 0 to 9.