87.3k views
5 votes
What is the output of this program? Assume the user enters 2, 5, 1, and 6.

numA = 0
for count in range(4):
answer = input ("Enter a number: ")
fltAnswer = float(answer)
numA = numA + fltAnswer
print (numA)

User JOSEFtw
by
5.4k points

2 Answers

2 votes

Answer:

14.0

Step-by-step explanation:

Edge 2021

What is the output of this program? Assume the user enters 2, 5, 1, and 6. numA = 0 for-example-1
User SURESH SANKE
by
5.0k points
5 votes

Answer:

14.0

Step-by-step explanation:

The loop converts each answer to a float. The accumulator variable adds the values entered.

2.0 + 5.0 + 1.0 + 6.0 = 14.0

User Amila De Silva
by
4.9k points