Informatics Practices
Find errors and rewrite the same after correcting the following code:
d1.key()
Python Dictionaries
1 Like
Answer
The correct method to retrieve all keys from a dictionary is keys(), not key().
The corrected code is:
d1.keys()
Answered By
2 Likes
Related Questions
Find errors and rewrite the same after correcting the following code:
pop d1[4]Find errors and rewrite the same after correcting the following code:
d1.item()Find errors and rewrite the same after correcting the following code:
d1.value()Find errors and rewrite the same after correcting the following code:
d1.gets(4, 80)