Question: Using python make a program to meet the following requirements... o The user should be able to enter any number of test scores. oThe program
Using python make a program to meet the following requirements...
o The user should be able to enter any number of test scores.
oThe program should validate every test score and only accept test scores that are entered in an integer form BETWEEN 0 and 100.
o The program should output the total number of test scores entered and the average of the test scores.
I'm having trouble omitting the invalid test scores and test score counts from my final average calculation.
Here is what I have:
total = 0 total_quiz = 0 userInput = input("enter a score or press 9999 to stop") while userInput != "9999": if userInput.isnumeric(): total += int(userInput) total_quiz += 1 if int(userInput) <= 100 and int(userInput) >= 1: print("valid score") else: print("this is not a compatible numeric value") userInput = input("enter another score or press 9999 to stop") print(total_quiz - 1) print(total / total_quiz)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
