Vidyalelo
Python · Q27

MCQs for Python Dictionaries: Exam

Programming · Python · question 27

Q27

What is the output of the following code:my_dict = 'a': 1, 'b': 2del my_dict['b']print(my_dict)

A.
{'a': 1, 'b': 2}
B.
{'a': 1}
Answer
C.
{'b': 2}
D.
{}

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board