A more Pythonic way do to this would be
id_to_name = {g['id']: g['name'] for g in list_of_genres}
And for i in range(len(list_of_genres))
is really a dangerous antipattern better replaced with for genre in list_of_genres: