Diagram of Local Enclosed Global and Builtin Scopes If the interpreter doesnt find the name in any of these locations then Python raises a NameError  - Information from realpython.com