Answer:
Following are the code to these question:
def convert_str_to_numeric_list (numbers):#defining a method convert_str_to_numeric_list that holds number as a parameter
numbers_list = numbers.split ()#defining a list that hols list value by using splits method
for i in range (len (numbers_list)):#use loop for calculate the length of list
if (numbers_list[i].isdigit ()):#use if that check digits in list
numbers_list[i] = int (numbers_list[i])#convert list value into numbers
else:#else block
return[] #use return to return list v
return numbers_list #returning list
def get_avg (numbers_list):#defining a method get_avg that holds list in parameter
if (len (numbers_list) != 0):#use if to check lenght of the list is not equal to 0
return sum (numbers_list) / len (numbers_list)#use return to calculate average of the list
else: #use else block
return None #return None value
def get_min (numbers_list):#defining get_min method that holds list in parameter
if (len (numbers_list) != 0):#use if to check lenght of the list is not equal to 0
return min (numbers_list) #use return to calculate the minimum element in list
else: #use else block
return None #return None
def get_max (numbers_list):#defining get_max method that holds list in parameter
if (len (numbers_list) != 0): #use if to check lenght of the list is not equal to 0
return max (numbers_list) #return minimum number in the list elements
else:# use else block
return None #return None
numbers = input () #defining numbers that use input method to input value
numbers_list = convert_str_to_numeric_list (numbers) #use list that pass hold the method value
average = get_avg (numbers_list)#defining average variable that calls get_avg method
minimum = get_min (numbers_list)#defining minimum variable that calls get_min method
maximum = get_max (numbers_list)#defining maximum variable that calls get_max method
if (len (numbers_list) != 0):#if to check lenght of the list is not equal to 0
print ("{:.0f} {} {}".format (average, minimum, maximum)) #print calculated values.
Output:
15 20 0 5
10 0 20
Step-by-step explanation:
In this code, a method "convert_str_to_numeric_list" is declared that holds a numbers variable as a parameter and inside this, a list is declared that
that splits the lists and in the for loop, it checks the length of the array and converts the list value into the numbers, and returns its values.
In the next step, "get_avg, get_min, and get_max" three methods are declared, that check the length of the list and return its respective values.
At the last, the numbers are declared that inputs values and passes into the list and use "average, minimum, and maximum" variable to call the method holds its value and at the last, it uses the print method to print its values.