3D array possible in Python | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

3D array possible in Python

if possible then how?

27th Feb 2017, 2:36 PM
Mrinal Kanti Ghosh
Mrinal Kanti Ghosh - avatar
6 Antworten
+ 4
list = [1,[2[3]],4]
27th Feb 2017, 3:27 PM
Chirag Bhansali
Chirag Bhansali - avatar
+ 3
It's simply index access of nested list: list = [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] print( list[0] ) # [ 1, 2 ] print( list[0][0] ) # 1
28th Feb 2017, 12:56 PM
visph
visph - avatar
+ 3
list[1][1][0] will output 3 : the innermost value in the array
28th Feb 2017, 2:49 PM
Chirag Bhansali
Chirag Bhansali - avatar
+ 2
I answered for the principle of nested arrays ^^ ( without dimension limit: works same way for 2, 3, 4... how much dimension you want )
28th Feb 2017, 2:50 PM
visph
visph - avatar
0
how to access??!
28th Feb 2017, 11:34 AM
Mrinal Kanti Ghosh
Mrinal Kanti Ghosh - avatar
0
I asked for 3d array not 2d!!!😐😣😣😣😣
28th Feb 2017, 2:47 PM
Mrinal Kanti Ghosh
Mrinal Kanti Ghosh - avatar