Write python code that does the following: Ask the user to enter as many as number they want; Then find the sum and the average of these numbers; Print both results. *Tip- you should use while loop and when the user enters a specific word, they can continue to add another number.

Respuesta :

Answer:

It goes like:

______________________________

#taking inpit for n numbers user wanna enter and save it in a variable n,

n=int(input("Enter the no. of no you want to enter: ")

#While loop after initialising a varaible to make suure the loop runs specific number of times

a=0

sum=0

while a>n:

b=int(input("Enter the number: "))

sum+= a

# printing the sum and average after rounding sum/n upto 2 digits after decimal.

print("sum:", sum, "/naverage:", round(sum/n,2) )

______________________________