How do you expect to get
I would suggest that you print both lines, just before the
Also, note that you open BOTH files before the 2 loops. In the first iteration of the outer loop, you iterate over whole file2 (the inner loop). At that point you are at the end of file 2 and line_fe=7. There is nothing to iterate any more, so for the next 2 loops in the outer loop, the inner loop does nothing
4, 5, 6, 7
in the output, when you print just lines from file 1, which end at 3?I would suggest that you print both lines, just before the
if
block.Also, note that you open BOTH files before the 2 loops. In the first iteration of the outer loop, you iterate over whole file2 (the inner loop). At that point you are at the end of file 2 and line_fe=7. There is nothing to iterate any more, so for the next 2 loops in the outer loop, the inner loop does nothing
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs