Given the dictionary, nested_d, save the medal count for the USA from all three Olympics in the dictionary to the list US_count
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}}
Here is what I am doing:
US_count = []
for nested in nested_d:
# print(nested)
for country in nested_d[nested]:
if "USA" in country:
US_count.append(country)
print(US_count)
I expect the output [35,36,46]
but the actual output is ['USA', 'USA', 'USA']
please help me solve this problem