• file

The OP’s code attempts to use for loops two or more times to re-read a file without rewinding the file using .seek() in between the for loops.