Learn Before
Concept
clear()
The clear() method removes all items from a set structure. Usage:
students = {"John", "Joe", "Jerry"} students.clear() print(student)
The clear() method removes all items in the student dictionary. The final print statement outputs {}.
0
2
Updated 2021-05-22
Tags
Python Programming Language
Data Science