Вы можете попробовать это: -
nested_d = {'Beijing':{'China':51, 'USA':36, 'Russia':22, 'Great Britain':19}, 'London':{'USA':46, 'China':38, 'Great Britain':29, 'Russia':22}, 'Rio':{'USA':35, 'Great Britain':22, 'China':20, 'Germany':13}}
US_count = []
for nested in nested_d:
for country,medal in nested_d[nested].items() :
if country == 'USA':
US_count.append(medal)
print(US_count)
Выход
[36, 46, 35]
OR
Вы можете попробовать это: -
us_count = []
for key, value in nested_d.items(): #Here we getting dictionary in value.
if 'USA' in value.keys():
us_count.append(value['USA'])
print(us_count)
Я надеюсь, что это может помочь вам