CBSE Class 11 Computer Science Question 52 of 88

Tuples and Dictionary — Question 17

Back to all questions
17
Question

Question 12(f)

Find errors and rewrite the same after correcting the following code:

d1.key()
Answer

The correct method to retrieve all keys from a dictionary is keys(), not key().

The corrected code is:

d1.keys()