Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
phonebook = {} # Empty dictinary to hold the details
#adding the information in the add entry function
def add_entry(index, phonenumber = None, email = None,address = None):
phonedetails = {"Tel": phonenumber,
"email": email,
"Address": address
}
global phonebook
phonebook.update({index : phonedetails})
#Function to show the phonebook
def show_phonebook(search):
print("# Showing the phonebook")
global phonebook
print(phonebook[search])
if __name__== "__main__":
# Create some entries then show the phonebook
print("# Creating some entries...")
add_entry('A A','0123456789','abc@def.com','Coventry, CV3 3AB')
add_entry('A B','0123456333','abc@lll.com')
show_phonebook('A B')
print("# Showing the phonebook")