Informatics Practices
Find errors and rewrite the same after correcting the following code:
d1(9) = 90
Python Dictionaries
3 Likes
Answer
In Python, we assign the key-value pair using square brackets [], not parentheses ().
The corrected code is:
d1[9] = 90
Answered By
1 Like
Related Questions
What are the differences between strings and dictionary?
Find errors and rewrite the same after correcting the following code:
d1 = {1:10, 2.5:20, 3:30, 4:40, 5:50, 6:60, 7:70}Find errors and rewrite the same after correcting the following code:
del d1(2)Find errors and rewrite the same after correcting the following code:
pop d1[4]