Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python coding: instructions: Edit the program provided so that it receives a series of numbers from the user and allows the user to press the

python coding:

instructions:

Edit the program provided so that it receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print:

  1. The sum of the numbers
  2. The average of the numbers

An example of the program input and output is shown below:

Enter a number or press Enter to quit: 1 Enter a number or press Enter to quit: 2 Enter a number or press Enter to quit: 3 Enter a number or press Enter to quit: The sum is 6.0 The average is 2.0

starter code:

# Edit the code below

while True:

number = input("Enter a number or press Enter to quit: ")

if number!="":

theSum += float(number)

count += 1

else:

break;

theAverage = theSum/count

print("The Sum of numbers: ",theSum)

print("The Average of numbers: ", theAverage)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

LO6 List the components of job descriptions.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago