跟我學Python一級
潘晟旻、方嬌莉、郝熙
相關主題
商品描述
目錄大綱
目 錄
ContentsContents
第1單元 進入Python樂園...............................................0011.1 認識Python .................................................................... 003
1.2 認識IDLE........................................................................ 007
1.3 編程就這麽簡單 .............................................................. 010
1.4 我來指揮電腦工作....................................................... 012
習題1...................................................................................... 014
第2單元 Python程序的小秘密........................................0162.1 標識符和關鍵字 .............................................................. 018
2.2 變量 ................................................................................ 021
2.3 註釋 ................................................................................ 025
2.4 縮進 ................................................................................ 029
2.5 續行符 ............................................................................ 030
2.6 Python 之禪 .................................................................... 031
習題2...................................................................................... 032
第3單元 奇妙的數字.......................................................0343.1 整數 ................................................................................ 035
3.2 浮點數 ............................................................................ 039
3.3 真值和假值 ..................................................................... 041
3.4 空值 ................................................................................ 042
3.5 認識表達式 ..................................................................... 043
3.6 算術復合賦值運算符....................................................... 045
3.7 牛刀小試......................................................................... 046
習題3...................................................................................... 048
第4單元 字符的隊伍——字符串....................................0504.1 字符串的創建.................................................................. 051
Gwxzw.indd 7 2023/2/10 9:40:01
4.2 字符串的引用 ..................................................................055
4.3 字符串的操作及常用方法 ................................................058
4.4 字符串的格式化 ..............................................................062
習題4 ......................................................................................066
第5單元 混合的隊伍——列表........................................069
5.1 列表的創建與刪除 ..........................................................070
5.2 列表的索引和訪問 ..........................................................073
5.3 列表元素的控制 ..............................................................076
習題5 ......................................................................................081
第6單元 變身小魔術——類型轉換.................................084
6.1 數字類型轉換 ..................................................................086
6.2 字符類型轉換 ..................................................................090
6.3 列表類型的轉換 ..............................................................092
習題6 ......................................................................................094
第7單元 會畫圖的小海龜...............................................098
7.1 小海龜登場 .....................................................................099
7.2 我在哪兒,我是誰 ..........................................................102
7.3 拿起畫筆畫 .....................................................................106
習題7 ......................................................................................114
第8單元 向左轉向右轉——分支結構...............................116
8.1 單分支結構 .....................................................................117
8.2 雙分支結構 .....................................................................121
8.3 多分支結構 .....................................................................124
8.4 分支的嵌套 .....................................................................128
習題8 ......................................................................................132
第9單元 周而復始的力量——循環結構..........................137
9.1 for循環 ...........................................................................138
9.2 while循環 .......................................................................143
9.3 改變循環的break和continue .........................................146
9.4 循環的嵌套 .....................................................................150
習題9 ......................................................................................154
第10單元 糾錯小能手——異常處理.................................161
10.1 try-except語句 .............................................................164
10.2 try-except-else語句 ......................................................167
10.3 try-except-finally語句 ....................................................169
習題10 ....................................................................................173
第11單元 Python工具箱——標準函數入門.....................177
11.1 函數的使用方法 ............................................................178
11.2 標準函數的應用 ............................................................179
習題11 ....................................................................................188
附錄A Python開發環境的搭建.........................................191
附錄B 青少年編程能力等級標準第2部分:
Python編程一級節選...........................................202
附錄C 標準範圍內的Python標準函數列表....................208