Solution: Contact book
This program stores contact information in a dictionary and then prints a specific phone number.
contactsis a dictionary — a collection of key–value pairs.Each key (like
"Mom"or"Pizza Place") is a label.Each value (like
"555-1234") is the information linked to that label.
To get a specific value, you use its key in square brackets:
Solution: Contact book
This program stores contact information in a dictionary and then prints a specific phone number.
contactsis a dictionary — a collection of key–value pairs.Each key (like
"Mom"or"Pizza Place") is a label.Each value (like
"555-1234") is the information linked to that label.
To get a specific value, you use its key in square brackets: