MCQs > IT & Programming > Python > Output of the following Python code. import collections c1 = { 'a' : 1, 'b' : 2 } c2 = { 'b' : 3, 'c' : 4 } c3 = { 'f' : 5 } ch = collections.ChainMap(c1, c2) #print (ch.maps) ch1 = ch.new_child(c3) #print (ch1.maps) print (ch1['b']) ch1.maps = reversed(ch1.maps) print (ch1['b'])

Python MCQs

Select the correct output of the following Python code from the given options.

import collections

c1 = { 'a' : 1, 'b' : 2 }

c2 = { 'b' : 3, 'c' : 4 }

c3 = { 'f' : 5 }

ch = collections.ChainMap(c1, c2)

#print (ch.maps)

ch1 = ch.new_child(c3)

#print (ch1.maps)

print (ch1['b'])

ch1.maps = reversed(ch1.maps)

print (ch1['b'])


Answer

Correct Answer:

2


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it