# Scope: Local and Global Variables

A variable made inside a function is local and disappears when the call ends, a variable made outside every function is global and can be read anywhere, and a function that takes values in and hands its result back is easier to trust than one that changes a global.

![Cheat sheet: Scope: Local and Global Variables](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a804dac4ef1c473d883eac5549eb3bf9.webp)

- Category: Python
- Level: Apprentice
- Tags: Global Variable (python), Local Variable (python), python, Scope (python)
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-functions-scope-cheat-sheet
