Ask coding questions

← Back to all posts
How to list a list in a list
RainBowLion1 (6)

i want to print a list thats in a list but i get a the error TypeError: 'int' object is not subscriptable is this posible if so how can i do it

Answered by InvisibleOne (2990) [earned 5 cycles]
View Answer
Comments
hotnewtop
InvisibleOne (2990)

Yeah, I did that same mistake my first time, do this:

list = [["list", 'Of', 'lists'], ['another', 'list', 'in', 'a', 'iist']]

data = list[0][0]

print(data)

you have it like this: list[0[0]] when it should be list[0][0]