I am writing a program for a course that takes user input exam scores and averages them. I have a functioning program, however I need to add a function that uses a range to identify scores entered outside of the 1-100 range and display a message "score out of range. please re enter".
Here is what I have so far:
SENTINEL = float(9999)
scores = []
while True:
number = float(input("Enter exam score (9999 to quit): "))
if number == SENTINEL:
break
scores.append(number)
if not scores:
print("No scores entered")
else:
avg = sum(scores)/len(scores)
print("average of ", len(scores), " test scores is :", avg)
9999, what's stopping you from implementing a check to see if they input a number that's more than 100 or less than 1? - user5407570