Don't do `file.readlines()`, just use `enumerate(file)`. `file.readlines()` reads the entire file into a list first, which is unnecessary/wasteful (though it probably doesn't matter in this case).