Course Content
Python Data Structures
Python Data Structures
Clear() Method
Just like in other data structures, the clear()
method completely wipes out all the elements. Let's dive into the example below.
set_1 = {10, 'Joe', 'cat', True, 134} print(set_1) set_1.clear() print(set_1)
Task
You've got the set:
Your task is to erase all the items from this set.
Thanks for your feedback!
Clear() Method
Just like in other data structures, the clear()
method completely wipes out all the elements. Let's dive into the example below.
set_1 = {10, 'Joe', 'cat', True, 134} print(set_1) set_1.clear() print(set_1)
Task
You've got the set:
Your task is to erase all the items from this set.
Thanks for your feedback!
Clear() Method
Just like in other data structures, the clear()
method completely wipes out all the elements. Let's dive into the example below.
set_1 = {10, 'Joe', 'cat', True, 134} print(set_1) set_1.clear() print(set_1)
Task
You've got the set:
Your task is to erase all the items from this set.
Thanks for your feedback!
Just like in other data structures, the clear()
method completely wipes out all the elements. Let's dive into the example below.
set_1 = {10, 'Joe', 'cat', True, 134} print(set_1) set_1.clear() print(set_1)
Task
You've got the set:
Your task is to erase all the items from this set.