Write the output of the following.
(b) list1 = [0, 5, 10, 15, 20, 25, 30] list1.clear() print(list1)
Answer:
Output: [ ]
Explanation:
The clear() method removes all the elements from a list.
Short Answer Type Questions (2 Marks each)
Last updated at April 16, 2024 by Teachoo
Answer:
Output: [ ]
Explanation:
The clear() method removes all the elements from a list.