CBSE Class 11 Computer Science Question 54 of 88

Tuples and Dictionary — Question 19

Back to all questions
19
Question

Question 12(h)

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

d1.gets(4, 80) 
Answer

The correct method to retrieve a value for a given key is get(), not gets().

The corrected code is:

d1.get(4, 80)