Endpoints for finding the country with highest population

“”"

Finding the most populated country

The inputs: year.

The output: list of dictionaries.

What the function is doing: filtering the country with highest population or

maximum value based on the which year they enter.

“”"

@app.route("/country/")

def most_populated_country(year):

populated_country = []

for populated in big_data:

    max(populated, key=lambda x:x['2020'])

    populated_country.append(populated_country)

return jsonify(populated_country)