Using information from a while loop to print a dictionary

If you create a blank dictionary: dict = {}
… you can then use dict[key] = value

If the key is already in said dictionary, the current value will be updated with a new value, else a new kay:value pair will be created.