CBSE Class 11 Informatics Practices
Question 12 of 29
Dictionary — Question 12
Back to all questionsThe correct method to clear all elements from a dictionary is clear(), not clears().
The corrected code is:
d1.clear()The correct method to clear all elements from a dictionary is clear(), not clears().
The corrected code is:
d1.clear()