Informatics Practices

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

d1.gets(4, 80) 

Python Dictionaries

2 Likes

Answer

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

The corrected code is:

d1.get(4, 80)

Answered By

1 Like


Related Questions