Vidyalelo
Python · Q85

MCQs for Python Dictionaries: Exam

Programming · Python · question 85

Q85

What will be the output of the following Python code snippet? numbers = letters = comb = numbers[1] = 56 numbers[3] = 7 letters[4] = 'B' comb['Numbers'] = numbers comb['Letters'] = letters print(comb)

A.
Error, dictionary in a dictionary can't exist
B.
Numbers': {1: 56, 3: 7}
C.
{'Numbers': {1: 56}, 'Letters': {4: 'B'}}
D.
{'Numbers': {1: 56, 3: 7}, 'Letters': {4: 'B'}}
Answer

Answer: Option D

Solution

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