Post

@PythonDvz Each loop repeats twice, so the iterations are as follows, so 0112 will print:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 2
English

@PythonDvz 0112
When i=0, j=0: prints 0 + 0 = 0, so output is 0
When i=0, j=1: prints 0 + 1 = 1, so output is 1
When i=1, j=0: prints 1 + 0 = 1, so output is 1
When i=1, j=1: prints 1 + 1 = 2, so output is 2
All together, the output will be: 0112
English

@PythonDvz 0112
Because the nested loop runs 4 times:
i=0, j=0 → 0
i=0, j=1 → 1
i=1, j=0 → 1
i=1, j=1 → 2
Since end="" is used, everything prints on the same line.
English




