Operating environment
CentOS 6.5
I want to handle 2D arrays in python.
reference http://d.hatena.ne.jp/yuheiomori0718/20121207/1354893179
151126a.py
onoff=[
[3, 1, 4, 1, 5],
[2, 7, 1, 8, 2],
[0, 5, 7, 7, 2],
]
print onoff[0][0],
print onoff[0][1],
print onoff[0][2]
print onoff[1][0],
print onoff[1][1],
print onoff[1][2]
print onoff[2][0],
print onoff[2][1],
print onoff[2][2]
Execution result
[toLearn]$ python 151126a.py
3 1 4
2 7 1
0 5 7
Recommended Posts