how can i print my dictionary keys?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

what i want to do is when i get weapon/item, i want it to display it name. so i need it name.

how can print “big wooden sword” from this?
DataImport.item_data["weapon"]["big wooden sword"]

if use DataImport.item_data["weapon"].keys() or DataImport.item_data["weapon"]["big wooden sword"].keys() it will print other thing too

sure i can put new key in dictionary "name of weapon": "big wooden sword", than use it.
but there other way to use what already in dictionary without put more key?

How are you accessing the dictionary values in the first place? If you already provide the key ("big wooden sword" in this case), why not print that or put it in a Label?

Ertain | 2021-05-16 23:45

:bust_in_silhouette: Reply From: Wakatta

You’re confusing keys and values

Dictionary key = the identifier before the colon
Dictionary value = what is referenced by the key
"key" : "value"

To print the value use