Objective
Create a Python program that stores contacts in a dictionary and looks up the phone number of one of them.
Instructions
- Read an integer
nand then the data ofncontacts: for each one, their name on one line and their phone number on the next. - Store them in a dictionary with the name as the key and the phone number as the value. If a name is repeated, keep the last phone number.
- Read the name to look for.
- Show their phone number, or
Not foundif that name is not in the book.
3
ana
600111222
luis
600333444
eva
600555666
luis
600333444
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise