NIELIT O Level Exam

<p>What will be the output of the following Python code snippet?</p> <pre><font color="#333333">numbers = {}<br></font><font color="#333333">letters = {}<br></font><font color="#333333">comb = {}<br></font><font color="#333333">numbers[1] = 56<br></font><font color="#333333">numbers[3] = 7<br></font><font color="#333333">letters[4] = 'B'<br></font><font color="#333333">comb['Numbers'] = numbers&nbsp;<br></font><font color="#333333">comb['Letters'] = letters<br></font><font color="#333333">print(comb)</font></pre><div><br></div>

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)


निम्नलिखित 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’}}




Correct Answer is :

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



Explanation
Dictionary in a dictionary can exist.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad