i try to learn better dict in python. I am using an api "chess.com"
data = get_player_game_archives(username).json
url = data['archives'][-1]
games = requests.get(url).json()
game = games['games'][-1]
print(games)
That's my code and they are no problem and the result is
{'games': [{'url': 'https://www.chess.com/live/game/8358870805', 'pgn': '[Event "Live Chess"]\n[Site "Chess.com"]\n
But i dont know how to get the "url", i tried
game = games['games']['url'] or
game = games['games'][{url}]
obviously i misunderstood something, but i dont know what.
Thanks for your reading
games['games']is a list so you need an index to access its element.