If I had a code like this:
a=input('#something')
while True:
if a == 0:
#Stop the program here
How would I end the program?
Thanks
If I had a code like this:
a=input('#something')
while True:
if a == 0:
#Stop the program here
How would I end the program?
Thanks
Yes, you usually do it this way:
import sys
sys.exit()
If there's an error you can indicate that by passing a string as in sys.exit("oops!")
.