Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a program in Python that calculates and displays the min, max, range, mean, median, average mode (average of all the modes for each city,

Implement a program in Python that calculates and displays the min, max, range, mean, median, average mode (average of all the modes for each city, if there are multi-modes in the list), and mode(s) of the weekly gas prices over a year of data for the three cities (Boston, Chicago, and Cleveland) as given below.

Boston = [2.643, 2.63, 2.632, 2.634, 2.635, 2.633, 2.636, 2.649, 2.654, 2.652, 2.654, 2.657, 2.663, 2.682, 2.669, 2.663, 2.674, 2.739, 2.761, 2.777, 2.791, 2.79, 2.806, 2.802, 2.814, 2.799, 2.791, 2.771, 2.788, 2.831, 2.859, 2.882, 2.893, 2.913, 2.923, 2.881, 2.808, 2.724, 2.654, 2.638, 2.61, 2.543, 2.491, 2.484, 2.477, 2.44, 2.458, 2.48, 2.506, 2.521, 2.518, 2.539]

Chicago = [2.731, 2.726, 2.726, 2.757, 2.683, 2.739, 2.804, 2.742, 2.726, 2.793, 2.839, 2.939, 2.931, 2.858, 2.986, 2.867, 2.792, 2.879, 2.923, 2.889, 2.905, 3.083, 3.193, 3.214, 3.385, 3.194, 3.156, 3.052, 2.967, 3.093, 3.265, 3.259, 3.263, 3.336, 3.267, 3.222, 3.183, 3.09, 3.098, 3.002, 2.88, 2.8, 2.665, 2.578, 2.609, 2.477, 2.41, 2.345, 2.255, 2.303, 2.268, 2.237]

Cleveland = [2.692, 2.567, 2.632, 2.585, 2.652, 2.554, 2.605, 2.486, 2.532, 2.495, 2.581, 2.679, 2.613, 2.647, 2.772, 2.656, 2.615, 2.622, 2.584, 2.661, 2.636, 2.781, 2.762, 2.839, 2.838, 2.733, 2.718, 2.624, 2.495, 2.566, 2.841, 2.646, 2.805, 2.702, 2.801, 2.732, 2.755, 2.677, 2.693, 2.65, 2.566, 2.502, 2.497, 2.412, 2.419, 2.296, 2.234, 2.18, 2.114, 2.059, 2.046, 2.011]

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

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

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions