There is a command to terminate the program in Python or you can just end it by using ways like this:
print()
There is a command to terminate the program in Python or you can just end it by using ways like this:
print()
In general, the end of the code ends the execution, of course if it is in a function called only the function will be finished and will return to the called.
It is recommended to leave the explicit intention other than in very trivial codes, so putting a final 'return' would be a good idea.
If you want to stop immediately at any point you can use sys.exit()
. Do not forget to import the import sys
module.