Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be done in Pyhton 2.7.14, please comment beside lines of code to help me understand what each line is doing. Must use the list

Must be done in Pyhton 2.7.14, please comment beside lines of code to help me understand what each line is doing.

Must use the list functions discussed below to add integers to the list:

"Because the population process calls for a specific task (i.e., the addition of an item to the list) to be repeated over and over again, let's use the while loop with a counter (initialized to 0)"

"Well, we want to add 20 randomly selected numbers to the list. To generate random numbers, we can make use of a Python library called random; specifically, a function in the library called randint."

image text in transcribed

Your task in this programming assignment is to write a Python program that generates a list of random integers, such that both its length and the minimum and maximum values added to the list are provided by the user. Subsequently, display the list, followed by statistics about the list. Here's output of a sample run (user input is shown in bold red): How many random integers would you like to add to the list? 10 What would you like the minimum value to be?-50 What would you like the maximum value to be? 50 The list: [-46, 43, 34, 48, 7, 31, 36, -11, 39, -9] The mean of the list is 17.2. The median of the list is 32.5 The range of the list is 94. Here's output of a second sample run (again, user input is shown in bold red) How many random integers would you like to add to the list? 7 What would you like the minimum value to be? 5 What would you like the maximum value to be? 999 The list: [866, 666, 447, 661, 688, 492, 81] The mean of the list is 557.285714286 The median of the The range of the list is 785 list is 661 To help clarify, here are some specifics and/or constraints (1) The random integers must be stored in a single Python list, (2) Generating the random list (including its length, and minimum and maximum values) must be done in a function that is called from the main part of the program (see the template for more details) (3) You must use the list functions discussed in class to add integers to the list, (4) Calculating the mean, median, and range of the list must be done in separate functions, one for (5) You must manually calculate the mean, median, and range of the list (i.e., without using math or (6) You must use the provided source code template; and each statistic; statistical functions provided in Python libraries), h you, you may use list functions to help (7) You must submit your source code as a single py file

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions