• @[email protected]
    link
    fedilink
    191 year ago

    Because exit might be a variable you use to determine if you should exit. exit() is a function that actually does the exiting.

    It’s the difference between pointing at a jogger and saying “run” and actually running after them.

    • @[email protected]
      link
      fedilink
      171 year ago

      If you have a variable called exit you’ve overwritten the function in that scope, and won’t be able to execute it.

      e.g.

      >>> exit=1
      >>> exit()
      Traceback (most recent call last):
        File "", line 1, in 
      TypeError: 'int' object is not callable
      >>>