Would anybody tell me what is the difference between builtin function exit() and quit().
Please correct me if I am wrong at any point. I have tried to check it but I am not getting anything.
1) When I use help() and type() function for each one, it says that both are object of class Quitter, which is defined in the module site.
2) When I use id() to check the addresses of each one, it returns different addresses i.e. these are two different objects of same class site.Quitter.
>>> id(exit)
13448048
>>> id(quit)
13447984
3) And since the addresses remains constant over the subsequent calls, i.e. it is not using return wrapper each time.
>>> id(exit)
13448048
>>> id(quit)
13447984
Would anybody provide me details about the differences between these two and if both are doing the same thing, why we need two different functions.
dieandexitare also synonyms. There, I recommendexitwhen the exit is planned, anddiewhen it’s the result of an error. In Python, you can do the same thing:exitwhen it’s planned andquitwhen there’s an error.