Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python initialize a 2d array

x = [[foo for i in range(10)] for j in range(10)]
# x is now a 10x10 array of 'foo' (which can depend on i and j if you want)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #initialize #array
ADD COMMENT
Topic
Name
9+9 =