I have a file "file.csv" with this code:
AAA;aaa
BBB;bbb
CCC;ccc
I have a script "program.py" with this code:
temp = open("file.csv", "rt")
for X in temp:
print("loop_1")
for Y in temp:
print(" loop_2")
temp.close()
And I have this result:
loop_1
loop_2
loop_2
But I wish I had this:
loop_1
loop_2
loop_2
loop_2
loop_1
loop_2
loop_2
loop_2
loop_1
loop_2
loop_2
loop_2
I don't understand the program's output.
I tried a loop inside another loop, but the result doesn't match with my expectation.