I have a following dictionary:
pokus = {1 : {"ahoj" : [{"visit" : [0, 0, 0]}]}}
Lets suppose I would like to print a value using print(pokus[1]["ahoj"][0]["visit"][0]). But I nedd [1]["ahoj"][0]["visit"][0] to be in an extra variable. I try this:
pokus = {1 : {"ahoj" : [{"visit" : [0, 0, 0]}]}}
insert = [1]["ahoj"][0]["visit"][0]
print(pokus[insert])
But I get an error TypeError: list indices must be integers or slices, not str . Is there a way how to do that in Python? Thanks