SolveItNCERT · CBSE Boards

CBSE 2026 · Central · Set 4 · Q24 · 2 marks

Assuming that D1 is a dictionary in Python,
(i)
Write a Python expression to check if the key, 'RNo' is present in D1.
(ii)
Write a single statement using a BUILT_IN function to add the key : value pair 'RNo' : $\displaystyle 12$, if the key 'RNo'is not present in D1. However, if the key 'RNo' is present, the function should return its value.

Revision of PythonDictionariesApplyvery_short_answer

More from Revision of Python

CBSE Class 12 Computer Science past-paper question from the 2026board exam, with the answer as CBSE’s own marking scheme gives it. Where our answers come from.