create empty list of lists python code example
Example 1: initialize a list of list in python
x = [[] for i in range(3)]
Example 2: py create empty list
# declare list
a = []
print("Values of a:", a)
print("Type of a: ", type(a))
print("Size of a: ", len(a))
# Output:
# > Values of a: []
# > Type of a: <class 'list'>
# > Size of a: 0
Example 3: empty list in python
# Python program to declare
# empty list
# list is declared
a = []
Example 4: python initialise list of lists
# initialise a list of n lists
n = 3
x = [[] for i in range(n)]