I am trying to read two test files and compare their data in python. the text files look like:
x y
x y
x y
x y
and I am trying to compare the values of x in both lists and then see if they have the same y values. I'm not too stuck on the comparing part, but I can't understand how to turn the text files into a pair of lists that would be able to be compared.
I know I should be stripping the lines like so
with open('xy.txt', 'r') as f:
xy = [line.strip() for line in f]
but I don't know how to sort them so I could sort them with an algorithm afterward. Any help would be greatly appreciated!