Python3 Att List Clear
# Python3.x Python3 List clear() Method
[ Python3 Lists](#)
* * *
## Description
The clear() function is used to empty a list, similar to **del a[:]**.
## Syntax
The syntax for the clear() method is:
list.clear()
## Parameters
* None.
## Return Value
This method does not return any value.
## Example
The following example demonstrates the usage of the clear() function:
## Example
#!/usr/bin/python3
list1 =['Google','Tutorial','Taobao','Baidu']
list1.clear()
print("List after clearing : ", list1)
The output of the above example is as follows:
List after clearing : []
[ Python3 Lists](#)
YouTip