python how to change an element in a multi dimensional list

Solutions on MaxInterview for python how to change an element in a multi dimensional list by the best coders in the world

showing results for - "python how to change an element in a multi dimensional list"
Ana Paula
16 Sep 2018
1multi_dimension = [[1, 2, 3], [4, 5, 6]]
2multi_dimension[1][1] = 7     # Value 5 (element 2) in list 2 is converted to 7
3# Can be ablied to any number of dimensions
4other_example[[[0, 1], [2, 3]], [[4, 5], [6, 7]]]
5other_example[0][1][0] = 8   # Value 2 (Element 2) in list2 of list1 in other_ 
6 							 # example is changed to 8