mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-27 14:01:15 +00:00
Update scope_resolution_legb_rule.ipynb
To match the above and following sentences.
This commit is contained in:
parent
c8fd4df339
commit
b145519291
|
@ -416,7 +416,7 @@
|
||||||
"global value [ a_var outside a_func() ]</pre>\n",
|
"global value [ a_var outside a_func() ]</pre>\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**c)** \n",
|
"**c)** \n",
|
||||||
"<pre>global value [ a_var in a_func() ] \n",
|
"<pre>global value [ a_var inside a_func() ] \n",
|
||||||
"global value [ a_var outside a_func() ]</pre>\n",
|
"global value [ a_var outside a_func() ]</pre>\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -457,7 +457,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"def a_func():\n",
|
"def a_func():\n",
|
||||||
" a_var = 'local value'\n",
|
" a_var = 'local value'\n",
|
||||||
" print(a_var, '[ a_var in a_func() ]')\n",
|
" print(a_var, '[ a_var inside a_func() ]')\n",
|
||||||
"\n",
|
"\n",
|
||||||
"a_func()\n",
|
"a_func()\n",
|
||||||
"print(a_var, '[ a_var outside a_func() ]')"
|
"print(a_var, '[ a_var outside a_func() ]')"
|
||||||
|
@ -475,11 +475,11 @@
|
||||||
"<pre>raises an error</pre>\n",
|
"<pre>raises an error</pre>\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**b)** \n",
|
"**b)** \n",
|
||||||
"<pre>local value [ a_var in a_func() ]\n",
|
"<pre>local value [ a_var inside a_func() ]\n",
|
||||||
"global value [ a_var outside a_func() ]</pre>\n",
|
"global value [ a_var outside a_func() ]</pre>\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**c)** \n",
|
"**c)** \n",
|
||||||
"<pre>global value [ a_var in a_func() ] \n",
|
"<pre>global value [ a_var inside a_func() ] \n",
|
||||||
"global value [ a_var outside a_func() ]</pre>\n"
|
"global value [ a_var outside a_func() ]</pre>\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user