KnowledgeBoat Logo
|

Informatics Practices

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

d1.item()

Python Dictionaries

2 Likes

Answer

The correct method to retrieve all key-value pairs from a dictionary is items(), not item().

The corrected code is:

d1.items()

Answered By

2 Likes


Related Questions