How to create an empty list in Python?

PythonServer Side ProgrammingProgramming

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
[]
raja
Published on 08-Feb-2018 19:14:03
Advertisements