Skip to content
Open
4 changes: 2 additions & 2 deletions 02.proof-of-work.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"\n",
"当然,为了这么做,你还要多学一样反正你早晚都必须学会的东西,Git —— 请参阅附录《[Git 入门](T-appendix.git-introduction.ipynb)》。\n",
"\n",
"时间就是这样,我们没办法糊弄它。而有了 git 这样的工具之后,我们在什么时候做了什么样的工作,是很容易证明的 —— 这对我们来说真是天大的好事。"
"时间就是这样,我们没办法糊弄它。而有了 git 这样的工具之后,我们在什么时候做了什么样的工作,是很容易证明的 —— 这对我们来说真是天大的好事。.."
]
},
{
Expand All @@ -114,7 +114,7 @@
"source": [
"(1) 使用浏览器访问 https://github.com/selfteaching/the-craft-of-selfteaching\n",
"\n",
"(2) 点击右上角的 “Fork 按钮”,将该仓库 Fork 到你的 Github 账户中\n",
"(2) 点击右上角的 “Fork 按钮”,将该仓库 Fork 到你的 Github 账户中..\n",
"\n",
"![](images/github-fork.png)\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions Part.1.A.better.teachyourself.ipynb

Large diffs are not rendered by default.

34 changes: 12 additions & 22 deletions Part.1.E.2.values-and-their-operators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -152,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -161,7 +161,7 @@
"3.14159"
]
},
"execution_count": 19,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
Expand All @@ -171,7 +171,7 @@
"3"
]
},
"execution_count": 19,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
Expand All @@ -181,7 +181,7 @@
"3.0"
]
},
"execution_count": 19,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -226,28 +226,18 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"20.0"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"ename": "TypeError",
"evalue": "can only concatenate str (not \"int\") to str",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-18-e922b7565e53>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;36m11\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m10\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m9\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;36m8\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m7\u001b[0m \u001b[0;34m//\u001b[0m \u001b[0;36m6\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0;34m'3.14'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m3\u001b[0m \u001b[0;31m# 这一句会报错\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str"
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mc:\\Users\\Administrator\\Documents\\GitHub\\the-craft-of-selfteaching\\Part.1.E.2.values-and-their-operators.ipynb 单元格 14\u001b[0m line \u001b[0;36m5\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.2.values-and-their-operators.ipynb#X16sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m InteractiveShell\u001b[39m.\u001b[39mast_node_interactivity \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mall\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.2.values-and-their-operators.ipynb#X16sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m \u001b[39m11\u001b[39m \u001b[39m+\u001b[39m \u001b[39m10\u001b[39m \u001b[39m-\u001b[39m \u001b[39m9\u001b[39m \u001b[39m*\u001b[39m \u001b[39m8\u001b[39m \u001b[39m/\u001b[39m \u001b[39m7\u001b[39m \u001b[39m/\u001b[39m\u001b[39m/\u001b[39m \u001b[39m6\u001b[39m \u001b[39m%\u001b[39m \u001b[39m5\u001b[39m\n\u001b[1;32m----> <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.2.values-and-their-operators.ipynb#X16sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m \u001b[39m'\u001b[39;49m\u001b[39m3.14\u001b[39;49m\u001b[39m'\u001b[39;49m \u001b[39m+\u001b[39;49m \u001b[39m3\u001b[39;49m \u001b[39m# 这一句会报错\u001b[39;00m\n",
"\u001b[1;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str"
]
}
],
Expand Down Expand Up @@ -1138,7 +1128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion Part.1.E.4.functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.21"
},
"toc-autonumbering": true
},
Expand Down
26 changes: 19 additions & 7 deletions Part.1.E.6.containers.ipynb

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions Part.1.E.7.files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,19 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"first line\n",
"second line\n",
"third line\n",
"\n"
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: '/tmp/test-file.txt'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mc:\\Users\\Administrator\\Documents\\GitHub\\the-craft-of-selfteaching\\Part.1.E.7.files.ipynb 单元格 13\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.7.files.ipynb#X15sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m f \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39;49m(\u001b[39m'\u001b[39;49m\u001b[39m/tmp/test-file.txt\u001b[39;49m\u001b[39m'\u001b[39;49m, \u001b[39m'\u001b[39;49m\u001b[39mw\u001b[39;49m\u001b[39m'\u001b[39;49m)\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.7.files.ipynb#X15sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39m'\u001b[39m\u001b[39mfirst line\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39msecond line\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39mthird line\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m'\u001b[39m)\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Administrator/Documents/GitHub/the-craft-of-selfteaching/Part.1.E.7.files.ipynb#X15sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m f\u001b[39m.\u001b[39mclose()\n",
"File \u001b[1;32mc:\\Users\\Administrator\\miniconda3\\envs\\new_env\\lib\\site-packages\\IPython\\core\\interactiveshell.py:310\u001b[0m, in \u001b[0;36m_modified_open\u001b[1;34m(file, *args, **kwargs)\u001b[0m\n\u001b[0;32m 303\u001b[0m \u001b[39mif\u001b[39;00m file \u001b[39min\u001b[39;00m {\u001b[39m0\u001b[39m, \u001b[39m1\u001b[39m, \u001b[39m2\u001b[39m}:\n\u001b[0;32m 304\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m 305\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mIPython won\u001b[39m\u001b[39m'\u001b[39m\u001b[39mt let you open fd=\u001b[39m\u001b[39m{\u001b[39;00mfile\u001b[39m}\u001b[39;00m\u001b[39m by default \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 306\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 307\u001b[0m \u001b[39m\"\u001b[39m\u001b[39myou can use builtins\u001b[39m\u001b[39m'\u001b[39m\u001b[39m open.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 308\u001b[0m )\n\u001b[1;32m--> 310\u001b[0m \u001b[39mreturn\u001b[39;00m io_open(file, \u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
"\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/tmp/test-file.txt'"
]
}
],
Expand Down Expand Up @@ -9696,7 +9698,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
9 changes: 5 additions & 4 deletions Part.2.D.1-args.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,15 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n"
"2\n",
"1\n"
]
}
],
Expand All @@ -448,7 +449,7 @@
"\n",
"n = 1\n",
"print(increase_one(n))\n",
"# print(n)"
"print(n)"
]
},
{
Expand Down Expand Up @@ -565,7 +566,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.21"
},
"toc-autonumbering": true
},
Expand Down
14 changes: 6 additions & 8 deletions Part.2.D.4-recursion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -201,7 +201,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -213,11 +213,9 @@
"dead: False kicked: False\n",
"dead: False kicked: False\n",
"dead: False kicked: False\n",
"dead: False kicked: False\n",
"dead: False kicked: False\n",
"dead: True kicked: True\n",
"I slept 8 days, and was dead to wake up...\n",
"The in_dream() function returns: 8\n"
"dead: True kicked: False\n",
"I slept 6 days, and was dead to wake up...\n",
"The in_dream() function returns: 6\n"
]
}
],
Expand Down Expand Up @@ -614,7 +612,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Loading