Python Programming - Lists - Discussion

Discussion Forum : Lists - General Questions (Q.No. 50)
50.
What does the clear() method do in Python lists?
Removes the last element from the list.
Removes all occurrences of a specific element.
Removes all elements from the list.
Removes elements from the list based on a condition.
Answer: Option
Explanation:
The clear() method in Python lists is used to remove all elements from the list, leaving it empty.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.