Computer Science, asked by shubham31031991, 6 months ago

**Using python**
Write a program which repeatedly takes input of numbers from the user until enters “notmore”.
Once “notmore” is entered, print out the total, count, and average of the numbers. If anything else
is given input, ignore that and continue with taking input.

Answers

Answered by valeriy69
0

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

nums = []

while True:

n = input("enter num: ")

if n == "notmore":

total = sum(nums)

count = len(nums)

print(f"total: {total}\ncount: {count}\naverage: {total / count}")

break

if n.isnumeric():

nums.append(int(n))

continue

\small\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Anonymous
4

Answer:

nums = []

while True:

n = input("enter num: ")

if n == "notmore":

total = sum(nums)

count = len(nums)

print(f"total: {total}\ncount: {count}\naverage: {total / count}")

break

if n.isnumeric():

nums.append(int(n))

continue

Similar questions