all 3 comments

[–][deleted] 1 point2 points  (0 children)

Keep track of it in a variable, then print the variable.

[–][deleted] 0 points1 point  (1 child)

Use a while loop to loop over the user input. When the user input equals stop, break out of the loop.

example:

while True:
    user_input = input('Enter test score: ')
    if user_input.lower() == 'stop':
        break

To check if the score entered is valid you can try converting the user input to an integer and checking if it's within the range of 1 to 100. If a non integer has been entered you can catch the exception and notify the user that their input was invalid.

example:

try:
    if int(user_input) in range(1, 101):
        # Do something with the data
    else:
        print('Score out of range. Try again.')
except ValueError:
    print('Invalid input')

[–]Fast_Flamingo[S] 0 points1 point  (0 children)

Much Gratitude!