What is the output of the following nested control structure in Python when executed?
for x in range(3):
for y in range(x):
print x,y
I know the answer is
1 0
2 0
2 1
But it is not clear for me why it is this output.
I know that the range(3) function would give you {0, 1, 2} so why is not the first output 0 0 instead of 1 0?
[0, 0)is empty.range()function.