python initialize list code example
Example 1: initialize a list of list in python
x = [[] for i in range(3)]
Example 2: how to initiate list with numbers python
verts = [None]*1000
or with numbers
verts = [0]*1000
Example 3: python initialise list of lists
# initialise a list of n lists
n = 3
x = [[] for i in range(n)]
Example 4: python initialize list
# Creating an empty list
lst = []
# Creating a list with elements
lst = [1, 2, 3, 4, 5]