Examveda

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: Option D


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python