0

I am creating a for loop in Python, which allows me to go through each record of a file to see whether the line is a duplicate or not. I have created a range, which reads through each line in the specified range. I was thinking of putting a range of infinity so taht literally any file size could be read in. But I do not know how to write that or if that is even possible. Below is what I currently have:

for i in range (0,10000):

Gary O'Neill
  • 27
  • 1
  • 3

1 Answers1

0

You can just open the file and it will return you an array of strings per line:

with open(file_name) as file:
    line = file.readlines()
Nathan Davis
  • 5,636
  • 27
  • 39
KNgu
  • 355
  • 4
  • 11