How to remove all elements from the list

PHOTO EMBED

Tue Apr 21 2020 06:34:03 GMT+0000 (Coordinated Universal Time)

Saved by @Melody #python #python #lists #clear #remove

# a characters list
          1.characters = ['a', 'b', 'c', 'd', 'e', 'f']
          2.characters.clear()
                                
                                
content_copyCOPY

"clear" is the keyword that is used in a list to remove all the elements from the list. When you run this code there will be no output.

https://learnandlearn.com/python-programming/python-reference/python-remove-list-all-items-clear-function-with-examples