IDNLearn.com is your go-to resource for finding answers to any question you have. Join our community to receive prompt, thorough responses from knowledgeable experts.

Write a program that accepts as input eight numbers from the keyboard and stores them in a list. Include sensible prompts so that the user knows what to do.Your program should then:On a single line, display the numbers with four spaces in between each number. Do not display brackets or commas.On a single line, display the numbers in reverse order with four spaces in between each number. Do not display brackets or commas.Display the sum of the numbers, with explanatory text. Limit the output to two decimal places.Display the average of the numbers, with explanatory text. Limit the output to two decimal places.On a single line, display each number that is higher than the calculated average with ten spaces between each number.

Sagot :

Display each number that is higher than the calculated average with ten spaces between each number.

# Function to print list of numbers def normal_print(numbers):  

# Iterate over list of numbers using for loop for i in range(len(numbers)):   print(str(numbers[i])+"    ",end="")

# Print elements and add 4 space  

print()  # Function to print reverse list of numbers def rev_print(numbers):  

# Iterate over list of numbers using for loop  for i in range(len(numbers)):   end_index = len(numbers)-i-1    

# Calculate index from the end of list  

print(str(numbers[end_index])+"    ",end="")

# Print elements at end index  print()  

# Function to calculate sum of list of numbers def sum_print(numbers):  sum_n = 0      

# Variable to store sum of elements for i in range(len(numbers)):

# Iterate over list of numbers using loop  

sum_n += numbers[i]  

# Add element into existing sum return sum_n      

# Return sum

# Function to calculate average of list of numbers def avg_print(numbers):  sum_n = sum_print(numbers)   # Get sum of numbers from list (using above function)  total = len(numbers)    # Get total elements in list  average = sum_n/total    # Calculate Average (Sum/Total) return average  # Main Function  # Declare an empty list of numbers numbers = []  # Get User input numbers and store them in list (append) for i in range(8):  numbers.append(float(input("Enter Number #"+str(i+1)+": ")))  # Print Results (each in single line) print() normal_print(numbers) rev_print(numbers) print("Sum of numbers: "+str(round(sum_print(numbers),2))) print("Average of numbers: "+str(round(avg_print(numbers),2)))

To know more about Limit, visit;

brainly.com/question/29545861

#SPJ4