Question #920

What is the output of the code snippet below?
my_list = ["apple", "banana", "orange", ]
my_list.clear()
print(my_list)

The clear() method removes all elements from a list. The clear() method returns None and empties the list in place. (programiz.com/python-programming/methods/list/clear)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: