Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

What is the purpose of an office memo? List the main elements.

Answered: 1 week ago

Question

Why do you think Catherine will or will not receive the position?

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago