sys.exit() gives an error in python.Why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

sys.exit() gives an error in python.Why?

Refer to my code "finite automata" https://code.sololearn.com/c7pc8QKnYmlo/?ref=app the above code accepts a finite automata and accepts the inputs to scan in that FA

13th Jan 2018, 6:25 AM
Sohamkumar Chauhan
Sohamkumar Chauhan - avatar
1 Answer
+ 5
That happened because your try statement doesn't have an except part. So do something like: import sys .... try: #code except: sys.exit()
13th Jan 2018, 9:38 AM
Tim Thuma
Tim Thuma - avatar