Report Bug

Qus

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

निम्नलिखित Python कोड स्निपेट का आउटपुट क्या होगा?

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’}}


Solution
D. {‘Numbers’: {1: 56, 3: 7}, ‘Letters’: {4: ‘B’}}



Explanation
Dictionary in a dictionary can exist.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz