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
[]

Updated on: 30-Jul-2019

470 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements