Write a program that asks the user to enter a list of number


Assignment

Write a program that asks the user to enter a list of numbers and then prints the countof the numbers in the list and the average of the numbers in the list. Do not use thelenfunction to find the length of the list. Use the accumulator pattern instead. The
program would print this when run.

Please enter a list of numbers: 1.0 10 3.5 4.2 10.6
There were 5 numbers in the list.
The average of the numbers was 5.86

\
solution
txt = input("Please enter a list of numbers: ")
lst = txt.split()
length = 0
sum = 0
___________________________________________________
___________________________________________________
___________________________________________________
print("There were",length,"numbers in the list.")
print("The average of the numbers was",sum/length)

The response should include a reference list. Double-space, using Times New Roman 12 pnt font, one-inch margins, and APA style of writing and citations.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Write a program that asks the user to enter a list of number
Reference No:- TGS02975398

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)