dictionary = {} file = open("data.txt") for line in file: key, value = line. split() # Split line into a tuple. dictionary[key] = value # Add tuple values to dictionary. print(dictionary)