Question: PYTHON - The two lists below are samples from a random distribution. Finish code with print statement to Print out whether List A or B
PYTHON - The two lists below are samples from a random distribution. Finish code with print statement to Print out whether List A or B has the larger standard deviation.
import random def generate_random_int_list(max_length, upper_bound): # generate random length between 2 and max_length list_length = int(random.uniform(2, max_length)) # given the length above, sample the Natural Numbers up to upper_bound that many times vars = random.sample(range(upper_bound), list_length) # return the generated list return vars # generate two random lists of integers max_length = 1000; upper_bound=1000000 A = generate_random_int_list(max_length, upper_bound) B = generate_random_int_list(max_length, upper_bound
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
