Need help with conditional ending

Hello, i need help on how to make a program run indefinitely until i end it with a specific phrase in terminal.

Say for example i have a simple grading program in vscode. Usually everytime the program ends (i input the value and the gets the output) i have to start it again from the beginning. Is there a way to make it like run indefinitely, meaning i can just put rhe value one by one without starting the program again and gets the output everytime?

Thank you for taking your time to help me with this. I just started coding and still confused about many things

You can use a while loop for this:

while some_condition:

This will loop as long as some_condition remains True (it will check on every loop).

You could use while True, which will run forever, and explicitly break when you get your stop value:

while True:
    value = input("Feed me grades")
    if value == "STOP":

As of 3.8 (which is the oldest supported version, now) you can use the walrus operator:

while (value := input("Feed me grades")) != "STOP":