Content deleted Content added
m Robot - Speedily moving category Variable (computer programming) to Category:Variable (computer science) per CFDS. |
m lang=python3 |
||
Line 6:
=== Nested functions === <!-- Please do NOT add the same example in other languages to this article. These two examples suffice to get the point across. Wikipedia is not a source code repository. -->
In the Python 3 example that follows there is a nested function <code>inner</code> defined in the scope of another function <code>outer</code>. The variable <code>x</code> is local to <code>outer</code>, but non-local to <code>inner</code> (nor is it global):
<source lang=
def outer():
x = 1
|