```
def function():
   restart = 'yes'
   while restart == 'yes':
       **long program here**
       restart = input("would you like to restart?: ")

```

In the /long program/ section, i have many variables and it would be crazy to put an 'if' statement on each if the user wants to exit the function, so is there a way that whenever prompted to enter for a variable, if the user enters 0 the program exits the function?

thanks