Skip to content

Commit

Permalink
remove a mistaken code cell
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolai committed Mar 27, 2019
1 parent eda91e1 commit 2d74849
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions Part.2.D.4-recursion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -484,30 +484,6 @@
"函数开始执行的时候,`x` 的值,是由外部代码(即,函数被调用的那一句)传递进来的。即便函数内部的变量名称与外部的变量名称相同,它们也不是同一个变量。"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4430918896\n",
"4467206608\n"
]
}
],
"source": [
"# 观察一下名称相同的一个全局变量和局部变量的不同内存地址\n",
"def f(n):\n",
" return id(n)\n",
" \n",
"n = 5\n",
"print(id(n)) # 全局变量 n 的内存地址\n",
"print(id(f(n))) # 局部变量 n 的内存地址。"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 2d74849

Please sign in to comment.