Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create an empty 2d list in python

#To create an empty 2d list of size n
l=[]
for i in range(n):
	l.append([])
#To create an 2d list of size rows and columns
l=[[0 for j in range(len(column))]for i in range(len(row))]
 
PREVIOUS NEXT
Tagged: #create #empty #list #python
ADD COMMENT
Topic
Name
4+8 =