CBSE Class 12 Computer Science — Python Dictionaries
All previous year questions from Chapter: Python Dictionaries
2 questions found
← Back to Computer Science
2026(2 questions)
- 25
(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.
1 mark· B· Dictionary Membership Operators - 26
(a) Write a single statement using a BUILT_IN function to add the key : value pair 'RNo' : 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.
1 mark· B· Dictionary Built-in Methods