Question: language: python Function Name: foodDesertLocator Parameters: cities ( list ) Returns: city_list (list) Description: A food desert is an area that has limited access to

language: python

language: python Function Name: foodDesertLocator Parameters: cities ( list ) Returns: city_list

Function Name: foodDesertLocator Parameters: cities ( list ) Returns: city_list (list) Description: A food desert is an area that has limited access to affordable and nutritious food; in other words, there aren't grocery stores within a certain mile radius to provide food to the people who live there. Write a function that takes in a list of cities and the number of peo- ple who are in that city without access to fresh food. Your function should first calculate the average number of people affected and then return a list of the city names with populations above that average. Note: The length of the list can vary! The list will be structured as follows: the name of the city, followed by that city's population, and so on. You can assume that every city will be fol- lowed by its population. >>> cities = ['San Francisco', 125000, 'Chicago', 500000, 'Atlanta', 2000000] >>> foodDesertLocator(cities) ['Atlanta'] >>> cities = ['New York City', 3000000, 'Atlanta', 2000000, 'Detroit', 30000, New Orleans', 50000] >>> foodDesertLocator(cities) ['New York City', 'Atlanta']

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 Databases Questions!