Exit and CTRL+C raise exception, which can also be caught.
SystemExit is raised by exit()
SystemExit is raised by exit()
while(True): try: exit() except: pass
Same goes for this code, which causes KeyboardInterrupt exception. Be careful running the code below, it will be very hard to stop it
while(True): try: a=input("") except: print("CTRL+C pressed")