Pretty new to python, but pretty familiar with basic syntax, so I apologize if the description isn't completely using the correct terms.
If I have a nested dictionary called standings, which contains a value that is a dictionary called Team, which contains a value called name that can be accessed with the following:
for dicts in standings:
print(dicts["team"]["name"])
How can I represent it like the following:
teamName = ["team"]["name"]
for dicts in standings:
print(dicts+teamName)
so basically want to change From:
dicts["team"]["name"]
to
dicts+variableName
to give the same result.
Dictionary snippet:
{'rank': 1, 'team': {'id': 50, 'name': 'Manchester City'}}
I've tried a few different ways, but can't see to figure it out without getting an error, wondering if maybe it's just not possible? (although I'm sure its just a user error on my part)
Thanks!