Question: Write a program that first creates a dictionary object student into with the following information (ID used as the key; Name used as the value):

 Write a program that first creates a dictionary object student into

Write a program that first creates a dictionary object student into with the following information (ID used as the key; Name used as the value): Student ID Student Name 001 002 003 Alice Bob Charlie Then, perform the following tasks: (1) Add the key-value pairs (004, David) and (001, Alex) into the student_into. (2) Use the del statement to remove the element with key '005. Use in or not in operator to avoid KeyError exception as necessary. (3) Use get method to retrieve and print the value associated with key '001 (4) Use pop method to retrieve and print the value associated with key '003'. Note that this will pop out the key-value pair of key 003 (5) Use items method to return and print all keys and corresponding values. value associated with key 001 is Alex value associated with key 003 is Charlie 001 Alex 002 Bob 004 David

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!