Scope

  • When you specify a variable inside a function, it is not accessible outside of a function
  • When you have a global variable, you can access it inside a function, but is better practice to pass it as an argument
  • If you create a variable inside an if block, or a loop, it is not local scope, it is global

Constant

Variables that you shouldn’t change after creating. To create one, write the variable in capital.

PI = 3.14
GOOGLE_URL = "https://www.google.com"