Please help me understand - What country has the highest percentage of people that earn >50K?

Tell us what’s happening:
I am confused about what the question wants as the answer, because I can only cross-check the final answer from the provided ‘test_module.py’, So my question is what percentage >50K means here, like for example take USA; The percentage of people earning >50K according to USA or in terms of the whole population,

so for percentage, what will it be,

A) pop / total pop
or
B) pop / total pop of that country

here, pop is the no of people earning > 50K, and total pop is the no rows in the dataset…

Mentioning the path to follow will really help me understand quickly, please give a glance of the solution if possible :grinning:

Your code so far
These are the pop values for each country… that I have calculated.

7171                 United-States
25                            Cuba
10                         Jamaica
40                           India
146                              ?
33                          Mexico
.........                      ............

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Demographic Data Analyzer

Link to the challenge:

It’s asking for what you’re calling B,

(pop in country with >50K) / (population of country) * 100

It seems like you’re on the right track. Once you calculate the percentage for each country, you can just pick the highest one.

1 Like

Got it,Thank You :+1:t2: