{ "cells": [ { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. meta::\n", " :description: Topic: variable score and namespaces in python, Difficulty: Medium, Category: Section\n", " :keywords: variable, namespace, function, scope, shadowing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Scope" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A valuable aspect of the \"encapsulation\" provided by functions is that the function's input argument variables, and any variables defined within the function, cannot be \"seen\" nor accessed outside of the function. That is, these variables are said to have a restricted **scope**.\n", "\n", "