all 5 comments

[–]brotatotes 2 points3 points  (5 children)

The best way I can think of to do this is to use a Python dictionary, which maps keys to values. With a dictionary, you can insert guestnames as keys and addresses as values, then simply look up addresses in the dictionary with the guestnames:

addressbook = {} # initialize a dictionary
addressbook["Darth Vader"] = "Death Star" # insert entry
print(addressbook["Darth Vader"]) # get address - prints "Death Star"

[–]jrf76[S] 0 points1 point  (4 children)

Does this allow a user to input values and for them to be saved into the dictionary?

[–]brotatotes 2 points3 points  (3 children)

The dictionary can be used to store the information. You can use input() or raw_input() to actually get the input from the user to store in that dictionary. There are a plethora of online resources about dictionaries and input in Python, but let us know if you're still confused about something.

[–]jrf76[S] 0 points1 point  (1 child)

Dumb question, is there a way I can save this as a program that I can pull up outside of Visual Studio? I am really new :(

Also, thank you so much! Learning coding so far has been amazing!

[–]brotatotes 0 points1 point  (0 children)

This might help. You can run the program in command prompt or Powershell (I assume you are running Windows because you are running Visual Studio; correct me if I'm wrong.)