Я бы предложил создать словарь:
# Open Text File
file = input("Enter the name of the score file: ")
print("Contestant score:")
open_file = open(file, "r")
lines = open_file.readlines()
# Convert into one single line for ease
mystr = '\t'.join([line.strip() for line in lines])
# Split it and make dictionary
out = mystr.split()
entries = dict([(x, y) for x, y in zip(out[::2], out[1::2])])
# Unsorted Display
print(entries)
# Sorted Display
print(sorted(entries.items(), key=lambda s: s[0]))
Вывод:
[('james', '3'), ('matt', '9'), ('peter', '5'), ('sophia', '5')]
Вы можете отображать / сохранять этот словарь в любой форме, например CSV, JSON или оставить его таким только.