Question
Must be done in Pyhton 2.7.14!!!!!!!!!!!! Pease 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!!!!!!!!!!!!
Pease 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."
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 fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started