Computer >> Computer tutorials >  >> Programming >> Python

How to create an empty list in Python?


You can create empty list object by giving no elements in square brackets in assignment statement. Empty list object is also created by list() built-in function without any arguments

>>> L1 = []
>>> L1
[]
>>> L1 = list()
>>> L1
[]