Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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):

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago