how to exit from the function in python code example Example: how to make player quit in python import sys sys.exit()