Instead of using an if statement to determine what file to read, you should ask the user for an input, and have a variable that stores the input file, like
fileName = input("~~~")
And then you have to open the file, which looks like
inFile = open(filename, "r")
The "r" is what tells the code to read the file, other letters do other things.
And then for actually reading the file, you can loop through the file like this:
for line in inFile:
And each loop will read the next line and store it as "line".
Youll want to use .split() to turn the read lines into a list, and use indexing [] and several if/elif statements to complete the problem.