I want to run a Python program function from a main function that controls the program function with
while True:
I'm led to believe this is good practice. I thought a return call in the program function would break me out, but I get stuck in an infinite loop. Typing "n" should break the loop - how do I do it and is this a sensible thing to do?
def main():
while True:
runPgm()
def runPgm():
while True:
a = str(input("Input?: "))
if a == 'n':
break
return
if __name__ == '__main__':
main()