while True:
input = raw_input("enter input: ")
result = useInput(input)
def useInput(input):
if input == "exit":
break #return 0 / quit / etc.. i want to break the while loop from within this function
I know I can put the “if logic” directly in the while loop, but I want it to be in the function. Is there a way to break a while loop from within a function called in the loop?
I usually do this: