Easy Tutorial
❮ Python Att List Remove Python Func Reversed ❯

Python Clear List

Python3 Examples

Define a list and clear the list using the clear() method.

Example 1

tutorialpro = [6, 0, 4, 1] 
print('Before clearing:', tutorialpro)  
  
tutorialpro.clear()
print('After clearing:', tutorialpro)

The output of the above example is:

Before clearing: [6, 0, 4, 1]
After clearing: []

Python3 Examples

❮ Python Att List Remove Python Func Reversed ❯