Why use def main()? [duplicate]

Without the main sentinel, the code would be executed even if the script were imported as a module.

Leave a Comment