Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python: [7] (20 Points) Assume you have a list containing the population of different cities. For example: >>city_populations [2123, 1284, 7031, 30788, 147, 2217,

In python:image text in transcribed

[7] (20 Points) Assume you have a list containing the population of different cities. For example: >>city_populations [2123, 1284, 7031, 30788, 147, 2217, 10000] Write a function called "getStats" that has one (1 input parameter (the list of city populations) and zero (0) output parameters and performs the following: Sorts the city populations in both ascending and descending order. Calculates the maximum, minimum, average, and standard deviation. Prints all of these results to the screen for the user to see You can use the built-in list functions: max0., min0, sum0, len0, etc. First, define a function calculating the average of the input list called "getMean" The function "getMean" should have one (1) input parameter (the list) and one (1) output parameter (the mean value)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions