Remove All Elements From a List in Python
To remove all elements from the list, we use the clear method. We pass nothing to its parameter:
pythonlst = [1, 2, 3]
lst.clear()
print(lst) # []
Задание 1
Given a list:
pythonlst = ['a', 'b', 'c', 'd', 'e']
Clean it up.
Задание 2
The lists are given:
pythonlst1 = [1, 2, 3]
lst2 = [4, 5, 6]
Combine them and output the result to the console. Then remove all elements from the second list.