# This is the code we need to enhance (edit this code to do the following above)
# Make sure to replicate results from the picture
# Display a welcome message
print("The Test Scores application")
print()
print("Enter test scores")
print("Enter 999 to end input")
print("======================")
# Initialize variables
counter = 0
score_total = 0
test_score = 0
while test_score != 999:
test_score = int(input("Enter test score: "))
if test_score >= 0 and test_score <= 100:
score_total += test_score
counter += 1
elif test_score == 999:
break
else:
print("Test score must be from 0 through 100. Score discarded. Try again.")
# Calculate average score
average_score = round(score_total / counter)
# Format and display the result
print("======================")
print("Total Score:", score_total,
"Average Score:", average_score)
print()
print("Bye")
Exercise 3-2 Enhance the Test Scores program In this exercise: you'll enhance the Test Scores program in figure 3-14 So the console display looks something like this: The Test Scores program
Enter Test Scores Enter end input
Enter test score Enter test score Enter test score: Enter test score end
Total Score: Average Score
Enter another set
Test Scores (xln) ?
Enter Test Scores Enter end input
Enter Test Scores Enter Test score Test score must be from Enter Test Scores Enter test score: Enter test score: end
0 through 100. Try again.
Total Score: 240 Average Score:
Enter another set
Test Scores (y/n) ?
Start IDLE and open the test scores py file that's in this folder: murach/python/exercises/ch03 Test the program with valid and invalid values: Enhance the program so it lets the user enter two or more sets of scores. Use a while loop to do that; that nests one while loop within another. Enhance this program so the user enters "end" to end set of score entries, but keep the validation of the test scores. To do this, you need to change the if statement within the inner while loop. In fact, you may want to nest one if statement within the else clause of another one to get the results that you want.