+ 1
Is there any way to produce a multidimensional list or dictionary or tuble as in arrays in c++
3 odpowiedzi
+ 4
You can cram together almost whatever you want in Python, like:
[(1, 2), {5: 6, 7:8}, 'ab', None, (3, 4, [7, 'blah'])]
+ 2
Of course :
Liste = [ [0, 1], [2, 3] ]
print(Liste[0][1])
#outputs 1
0
It works for tuples too.
For dictionnaires :
D = {"a" : {"a" : 2}}
print(a["a"]["a"])
#outputs 2