I have a text file where i have numbers and names listed. each number belongs to a specific name, and they belong on the same line. the content of the file, looks like this:
It seems a dictionary would idealy suit the case. I would try this:
names_dictionary = dict() f = open("hei.txt", "r") for name, number in zip(f, f): names_dictionary[name] = number
to update any number simply:
names_dictionary[name] = any_number