Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

initialize a 2d list python

>>> y = [['' for i in range(3)] for j in range(3)]
[['', '', ''], ['', '', ''], ['', '', '']]
>>> y[0][0]=1
>>> print(y)
[[1, '', ''], ['', '', ''], ['', '', '']]
Comment

PREVIOUS NEXT
Code Example
Python :: How to Get the Intersection of Sets in Python 
Python :: python selenium send keys enter send 
Python :: django login page 
Python :: How do I iterate over a subfolder in Python 
Python :: python __str__ vs __repr__ 
Python :: drop portion of string in dataframe python 
Python :: play video in python console 
Python :: pandas sort dataframe by index 
Python :: download image from url python requests 
Python :: python circular import 
Python :: pytest teardown method 
Python :: python crop string 
Python :: python string cut left 
Python :: validate ip address 
Python :: python verificar se é numero 
Python :: pygame text wrapping 
Python :: numpy random choice 
Python :: how to make every letter capital in python 
Python :: pd.datafram 
Python :: how to see the whole dataset in jupyterlab 
Python :: pandas do not display index 
Python :: vscode in browser github 
Python :: numpy randn with a shape of another array 
Python :: django sample 
Python :: how to reference variable in another file python 
Python :: lambda function in python 
Python :: flask vs django 
Python :: how to get what type of file a file is in python 
Python :: deleting a file using python 
Python :: gaussian filter 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =