Skip to content

Commit

Permalink
更新說明檔
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgau committed Mar 27, 2017
1 parent 364cb4e commit 04b4823
Show file tree
Hide file tree
Showing 3 changed files with 644 additions and 54 deletions.
7 changes: 7 additions & 0 deletions 01_basics/02. Python 安裝及使用.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@
" - 多行註解 ''' '''\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 魔術命令"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
101 changes: 100 additions & 1 deletion 01_basics/03. Python 的變數.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
},
"outputs": [],
"source": [
"# Python 的 string 模組已經把一些常用的字元分類定義好了 (備忘)\n",
"\n",
"import string\n",
"\n",
"# help(string)\n",
Expand All @@ -102,7 +104,7 @@
},
"outputs": [],
"source": [
"# Keywords\n",
"# 從 keyword 模組裡面可以取得所有的 keywords\n",
"\n",
"import keyword\n",
"\n",
Expand All @@ -120,6 +122,8 @@
},
"outputs": [],
"source": [
"# 從 builtins 模組裡面可以取得所有的內建物件\n",
"\n",
"# https://docs.python.org/3/reference/executionmodel.html\n",
"\n",
"# built-in objects\n",
Expand All @@ -136,6 +140,101 @@
"print(dir(builtins))"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## <font color='red'>Dynamic Type</font> v.s. Static Type"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"a = 123\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"a = 'abc'\n",
"a"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## <font color=\"red\">Strong Type</font> v.s. Weak Type"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"a = 123\n",
"b = \"abc\"\n",
"a + b"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### 數值型態跟非數值型態的運算,必須明確的轉型"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"a = 123\n",
"b = \"abc\"\n",
"str(a) + b"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
Loading

0 comments on commit 04b4823

Please sign in to comment.