To create an empty list in Python, you can use empty square brackets []
or the list()
constructor.
In this example,
[]
to create an empty list.empty_list
.empty_list = []
print('Empty list:', empty_list)
Empty list: []
In this example,
list()
constructor to create an empty list.empty_list
.empty_list = list()
print('Empty list:', empty_list)
Empty list: []
In this tutorial, we learned How to create an Empty List in Python language with well detailed examples.