1.

Write a program to input your friends’ names and their Phone Numbers and store them in the dictionary as the key-value pair. Perform the following operations on the dictionary:a) Display the name and phone number of all your friendsb) Add a new key-value pair in this dictionary and display the modified dictionaryc) Delete a particular friend from the dictionaryd) Modify the phone number of an existing friende) Check if a friend is present in the dictionary or notf) Display the dictionary in sorted order of names

Answer» Write a program to input your friends’ names and their Phone Numbers and store them in the dictionary as the key-value pair. Perform the following operations on the dictionary:

a) Display the name and phone number of all your friends

b) Add a new key-value pair in this dictionary and display the modified dictionary

c) Delete a particular friend from the dictionary

d) Modify the phone number of an existing friend

e) Check if a friend is present in the dictionary or not

f) Display the dictionary in sorted order of names


Discussion

No Comment Found