+ 5
I still can't figure how we arrived at this print(things[2][2])
clarification on the example question
2 Réponses
+ 6
The double use of [ ] means that we are calling a list in a list. The first [ ] is the index of the "master" list. This returns an internal list, for which the second [ ] then calls the element at that index
+ 1
Please check this code to understand the mechanism.
l = [45,[1,2,3],['a','b']]
print (l[1])
print (l[1][0])
print (l[1][1])
print (l[1][2])