Python Programming - Lists - Discussion

Discussion Forum : Lists - General Questions (Q.No. 13)
13.
What is the purpose of the clear method in Python lists?
To remove the last element from the list.
To remove all occurrences of a specific element.
To remove all elements from the list.
To remove 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.