exit in python 3.7 code example Example: exit in python import sys msg = "bye bye" sys.exit(msg) # you can use it with out a msg