+ 1
How can i get the value from the list that is in a dictionary?
dic={"a":[1,2]} I want to get, for example, 2, how should I do this? Is it like print (dic ["a"][0][1])#?
2 Answers
+ 1
Some explanations about dictionaries.
https://code.sololearn.com/ckNondB1JT7f/?ref=app
+ 1
Théophile Thanks, I tried this one
dict={"w":[1,2]}
for value in dict.values():
print(value [1])
Unfortunately, it works not in all cases. I'll continue to experiment