Write a program that prompts the user for a strictly


Task 1 -

Run and study the following code. Then extend it with your own code to compute the difference between the largest and smallest values in the list without using the builtins min() and max(), print it out, and check that the result is correct using the builtins.

Prompts the user for a seed for the random number generator,

and for a strictly positive number, nb_of_elements.

Generates a list of nb_of_elements random integers between 0 and 99,

prints out the list, computes the maximum element of the list without using the

builtin max(), prints it out, and confirms that the value is correct with the builtin.

Task 2 -

Run and study the following code. Then extend it with your own code to, without changing the seed, generate, a new list of the same length as the one generated before, but consisting of random elements between 0 and 19 included, compute the number of elements strictly less 5, 10, 15 and 20, and print those numbers out.

The operators /, // and % are used for floating point division, integer division, and remainder, respectively.

Prompts the user for a strictly positive integer, nb_of_elements,

generates a list of nb_of_elements random integers between 0 and 99, prints out the list,

computes the number of elements equal to 0, 1, 2 3 modulo 4, and prints those out.

Task 3 -

Write a program that prompts the user for a strictly positive integer N, generates a list of N random integers between -50 and 50 (included), prints out the list, computes the mean, the median and the standard deviation, and prints them out.

Compute them without using the mean(), median(), and pstdev() functions from the statistics module, and then check use these functions to check the results.

from random import seed, randint

from math import sqrt

from statistics import mean, median, pstdev

import sys

Attachment:- Assignment Files.rar

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a program that prompts the user for a strictly
Reference No:- TGS02684062

Expected delivery within 24 Hours