For exemple, say i have the following code:
a = [[1],[2],[3]]
for c in a:
print(c)
for d in a:
print(d)
The current output of it is:
[1]
[1]
[2]
[3]
[2]
[1]
[2]
[3]
[3]
[1]
[2]
[3]
My question is whether it is possible to modify this code in a pretty way so that the output becomes like this:
[1]
[2]
[3]
[2]
[3]
[3]
In other words if it is possible, in a 'clean python', to have the inner loop to cover the list from the index the outer loop stopped.