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)

Question:
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)

1.Error, dictionary in a dictionary can’t exist

2. ‘Numbers’: {1: 56, 3: 7}

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

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

Posted Date:-2021-12-31 09:56:25


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!