What is the output? d = {'a': 1, 'b': 2}
What is the output?
d = {'a': 1, 'b': 2}
print(d.get('c', 0))
Show answerHide answer
Correct answer: (C) 0
Explanation
get() returns the default when the key is missing.
Correct answer: (C) 0
Explanation
get() returns the default when the key is missing.
This is question 143 of DSSSB TGT Computer Science Full Mock Test 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.