SolveIt is under development
SolveItNCERT · CBSE · NEET
Question 11 / 13 · latest first
✓ Board-verified
Computer Science · 2026 · 2 marks

CBSE 2026 · Central · Set 4 · Q24

Assuming that D1 is a dictionary in Python, (i) (a) Write a Python expression to check if the key, 'RNo' is present in D1.

Assuming that D1 is a dictionary in Python,
(i)
(a)
Write a Python expression to check if the key, 'RNo' is present in D1.
OR
(b)
Write a Python expression to check if any key in D1 has a value 12.
(ii)
(a)
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.
OR
(b)
Write a single statement to delete all the elements from D1.
ShareWhatsAppTelegram

More from Revision of Python

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