I had in mind something analogous to
r = [] for x in range(5): if 2>x: for y in range(5): r.append((x,y))
r = [] for x in range(5): for y in range(5): if 2>x: r.append((x,y))
I had in mind something analogous to
I think what you wrote probably does: The first loop completely skips looping over y if the condition on x fails, the second loop repeatedly tests x.