Answer:
from random import seed, choices
from statistics import mean
number = int(input("Enter integer number: "))
if number > 0:
try:
data = range(number+1)
# to generate a pseudo-random number list.
seed(10)
# you can also use: num_list = [random.randint(0, number+1) for i in data]
num_list = choices(data, k=len(data))
print(num_list)
mean_val = round(mean(num_list), 2)
min_val = min(num_list)
max_val = max(num_list)
except ValueError:
print("Must be an integer value.")
print('Avg number: {}\\Max number: {}\\Min number: {}'.format(mean_val, max_val, min_val))
Step-by-step explanation:
To generate random items in a list of integers, the random choices method is used and a sequence is passed as an argument. The average, maximum, and minimum number of the list is calculated and displayed.