I'm coding a text-based adventure game for my python project in school, and I'm currently creating a fight function. It involves a lot of dictionaries, hence why I need to refer to a variable from a string. Here is an example of what I am asking!
some_dict = {
'one':1,
'two':2
}
x = 'some_dict'
print(x)
print(x['one'])
I want it to print the dictionary dict, not the string 'dict'. Then on the second print, I would want it to print the value in 'one', from the dictionary dict. Is there some function that can convert the string to a variable some how or check for a variable matching the string? Or something along those lines? Thank you so much!