17 lines
316 B
Python
17 lines
316 B
Python
# Implements a phone book using a dictionary
|
|
|
|
from cs50 import get_string
|
|
|
|
people = {
|
|
"Carter": "+1-617-495-1000",
|
|
"David": "+1-617-495-1000",
|
|
"John": "+1-949-468-2750",
|
|
}
|
|
|
|
# Search for name
|
|
name = get_string("Name: ")
|
|
if name in people:
|
|
print(f"Number: {people[name]}")
|
|
else:
|
|
print("Not found")
|