MCQ Answer

<p>What will be the output of the following Python code snippet?</p> <pre><font color="#333333">a={1:"A",2:"B",3:"C"}<br></font><font color="#333333">print(a.get(3))</font></pre>

What will be the output of the following Python code snippet?

a={1:"A",2:"B",3:"C"}
print(a.get(3))


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

a={1:"A",2:"B",3:"C"}
print(a.get(3))
Topic : Sequence data types in python

A. Error, invalid syntax एरर,इनवैलिड सिंटैक्स

B. A

C. 5

D. C




Correct Answer is :

D. C



Explanation
The get() method returns the default value(second parameter) if the key isn’t present in the dictionary.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 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 Best Website and Software Company in Allahabad