Challenge: Contact book
Explore how to create a contact book in Python by using dictionaries to store contacts and their phone numbers. This lesson helps you understand basic dictionary operations and how to display data with print statements, enabling you to build and manage simple reusable data structures.
We'll cover the following...
We'll cover the following...
Create a mini contact book using a dictionary:
Create a dictionary called
contacts.Add at least three contacts (e.g., family, friends, places) as keys and their phone numbers as values.
Use a
print()statement to display one of the contact’s phone numbers in a friendly sentence.