two dimensional array python

Solutions on MaxInterview for two dimensional array python by the best coders in the world

showing results for - "two dimensional array python"
Viktoria
06 Jan 2017
1# Creates a list containing 5 lists, each of 8 items, all set to 0
2w, h = 8, 5;
3Matrix = [[0 for y in range(h)] for x in range(w)] 
4
5Matrix[0][0] = 1
6Matrix[0][6] = 3 # error! range... 
7Matrix[6][0] = 3 # valid
8