Question: * check comments for data list * Write a Python code ( beginner level ) for each city that calculates the following: 1 . The

*check comments for data list*
Write a Python code (beginner level) for each city that calculates the following:
1. The number of people in the city.
2. The height and name of the SHORTEST person that is GREATER than the average height of all people in the city. (basically find who is right above average)
3. The height and name of the SECOND SHORTEST person that is GREATER than the average height of all people in the city.
Each row in your output must display the city name, the city's population, and the average height of all of the people in the city to 2 decimal places, BEFORE the names and heights of the people you calculated statistics for.
**You must NOT assume that the set of cities is restricted to the cities contained in this particular data file. Write your solution to handle any set of cities that might be present in the data.
Output the results in a neat, evenly spaced tabular form.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!