I'm running into an issue with the following python 3.x code in which the while(keepAlive):
continues, even after keepAlive
is false. When the user enters "1", Killing Program...
is displayed but while loop continues. I'm familiar with other languages, but just starting out with python. It seems like I must have made a simple mistake... I'd appreciate it if someone could point it out.
keepAlive = True
def main():
if(input("Enter 1 to end program") == "1"):
print("Killing program...")
keepAlive = False
while(keepAlive):
main()
Thanks