CBSE Class 11 Informatics Practices Question 32 of 66

Dictionary — Question 4

Back to all questions
4
Question

Question 3(b)

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

d1(9) = 90 
Answer

In Python, we assign the key-value pair using square brackets [], not parentheses ().

The corrected code is:

d1[9] = 90