零基礎學Python編程實戰

林富榮

  • 出版商: 電子工業
  • 出版日期: 2024-08-01
  • 售價: $390
  • 貴賓價: 9.5$371
  • 語言: 簡體中文
  • 頁數: 228
  • ISBN: 712148482X
  • ISBN-13: 9787121484827
  • 相關分類: Python
  • 立即出貨 (庫存 < 3)

相關主題

商品描述

本書通過經典案例,由淺入深地介紹了 Python 及其應用。本書註重素質的培養,註重練 習的實用性、可操作性和趣味性。本書章節安排科學、合理,可引導讀者學習、鞏固、綜合 運用 Python。本書內容新穎、圖文並茂、實例豐富、通俗易懂,可供因特網開發人員、財務管理人員、 人力資源管理人員、運營管理人員,以及培訓機構等相關人員閱讀,亦可作為初學者的入門教材。

目錄大綱

基礎篇 .............................................................................. 1
第一章 Python 概述 ........................................................................ 2
1.1 Python 的起源 ............................................................... 2
1.2 GPL 協議 ..................................................................... 4
1.3 Python 為什麽流行 ......................................................... 5
1.4 Sublime Text ............................................................... 8
第二章 Python 環境的搭建 ............................................................... 9
2.1 2.2
初級實戰篇
安裝 Python .................................................................. 9
安裝 Sublime Text ...................................................... 14
..................................................................... 21
第三章 Python 的第一行代碼 .........................................................
3.1 第一行代碼 ...............................................................
3.2 註釋 ........................................................................
3.3 引號 ........................................................................
3.4 縮進 ........................................................................
3.5 Unicode ..................................................................
3.6 轉義字符 ..................................................................
3.7 運行 Python 文件 .........................................................
第四章 變量.................................................................................
4.1 變量的賦值 ...............................................................
4.2 整數 ........................................................................ 34
4.3 浮點數 ..................................................................... 36
4.4 復數 ........................................................................ 37
4.5 字節串 ..................................................................... 37
4.6 布爾值 ..................................................................... 39
4.7 輸入 ........................................................................ 40
4.8 輸出 ........................................................................ 41
4.9 格式化輸出 ............................................................... 42
4.10 ASCII 碼 .................................................................. 44
4.11 將數據轉換為字符串 ................................................... 45
第五章 運算................................................................................. 46
5.1 加法 ........................................................................ 46
5.2 減法 ........................................................................ 47
5.3 乘法 ........................................................................ 48
5.4 除法 ........................................................................ 49
5.5 整除 ........................................................................ 51
5.6 取餘 ........................................................................ 51
5.7 次方 ........................................................................ 52
5.8 按位與 ..................................................................... 53
5.9 按位或 ..................................................................... 54
5.10 按位異或 .................................................................. 55
5.11 按位取反 .................................................................. 56
5.12 按位左移 .................................................................. 57
5.13 按位右移 .................................................................. 58
5.14 邏輯運算 .................................................................. 59
第六章 數據結構........................................................................... 63
6.1 序列 ........................................................................ 63
6.2 列表 ........................................................................ 71
6.3 棧 ........................................................................... 78
6.4 隊列 ........................................................................ 79
6.5 元組 ........................................................................ 80
6.6 字典 ........................................................................ 85
6.7 集合 ........................................................................ 91
第七章 字符串.............................................................................. 99
7.1 字符串拼接 ............................................................... 99
7.2 截取字符串 ............................................................... 101
7.3 字符串長度 ............................................................... 103
7.4 字符串字節數 ............................................................ 103
7.5 分割字符串 ............................................................... 105
7.6 合並字符串 ............................................................... 106
7.7 字符串大小寫轉換 ...................................................... 107
7.8 統計字符串 ............................................................... 109
7.9 檢索字符串位置 ......................................................... 110
7.10 字符串對齊 ............................................................... 111
7.11 檢索字符串 ............................................................... 113
7.12 格式化輸出 ............................................................... 114
7.13 其他函數 .................................................................. 115
中級實戰篇 .................................................................. 117
第八章 流程控制........................................................................... 118
8.1 條件語句 .................................................................. 118
8.2 斷言語句 .................................................................. 121
8.3 循環語句 .................................................................. 123
8.4 pass 語句 .................................................................. 126
第九章 函數和 lambda 表達式 ......................................................... 128
9.1 函數是什麽 ............................................................... 128
9.2 zip() 函數 .................................................................. 129
9.3 reversed() 函數 ......................................................... 130
9.4 sorted() 函數 ............................................................ 131
9.5 位置參數 .................................................................. 132
9.6 關鍵字參數 ............................................................... 133
9.7 默認參數 .................................................................. 134
9.8 return 語句 ............................................................... 135
9.9 全局變量 .................................................................. 136
9.10 局部變量 .................................................................. 138
9.11 局部函數 .................................................................. 139
9.12 lambda 表達式 ......................................................... 140
9.13 import ..................................................................... 140
第十章 類和對象........................................................................... 142
10.1 面向對象 .................................................................. 142
10.2 類的創建 .................................................................. 142
10.3 類的實例化 ............................................................... 144
10.4 self 的用法 ............................................................... 145
10.5 變量 ........................................................................ 146
10.6 靜態方法 .................................................................. 148
10.7 封裝 ........................................................................ 150
10.8 繼承 ........................................................................ 151
10.9 方法重寫 .................................................................. 153
10.10 調用父類的構造方法 ................................................ 154
10.11 多態 ..................................................................... 155
10.12 枚舉 ..................................................................... 156
第十一章
類的屬性和方法............................................................... 158
11.1 __init__() 方法 ......................................................... 158
11.2 __str__() 方法 ......................................................... 159
11.3 __call__() 方法 ......................................................... 160
11.4 __len__() 方法 ......................................................... 161
11.5 __del__() 方法 ......................................................... 162
11.6 __dir__() 方法 ......................................................... 163
11.7 生成器 ..................................................................... 164
異常處理機制.................................................................. 166
12.1 語法錯誤 .................................................................. 166
12.2 try...except ............................................................... 168
12.3 try...except...else ...................................................... 170
12.4 try...except...finally ................................................... 172
模塊和包........................................................................ 174
13.1 import ..................................................................... 174
13.2 import as ............................................................... 176
13.3 from import as ......................................................... 177
13.4 import 自定義模塊 ................................................... 178
文件操作........................................................................ 180
14.1 文件路徑 .................................................................. 180
14.2 刪除文件 .................................................................. 181
14.3 打開文件 .................................................................. 182
14.4 寫入文件數據 ............................................................ 184
14.5 tell() 函數 ............................................................... 185
14.6 with...as .................................................................. 186
高級實戰篇 .................................................................. 189
第十五章
Word 的基礎操作 ............................................................ 190
15.1 安裝 python-docx 模塊 ............................................. 190
15.2 創建標題 .................................................................. 192
15.3 創建文本內容 ............................................................ 193
15.4 創建列表 .................................................................. 194
15.5 創建表格 .................................................................. 196
15.6 創建圖片 .................................................................. 197
Excel 的基礎操作 ............................................................ 199
16.1 安裝庫 ..................................................................... 199
16.2 創建 Excel 表單 ......................................................... 201
16.3 創建文本內容 ............................................................ 202
16.4 創建樣式 .................................................................. 204
第十六章
實戰項目:員工在職證明................................................... 206
第十七章
附錄 A 進制轉換表 ........................................................................ 211
附錄B Pandas命令.....................................................................212
附錄C Python庫........................................................................214