
本課程聚焦於 Python 程式設計的基礎核心:變數、資料、運算子與輸出。學習者將了解變數由資料型態與變數名稱組成,並須遵守特定的命名規則,例如不可使用保留字。內容詳細介紹了 Python 的主要型態,包括數字、布林值、字串 (str),以及四種容器型態:串列(list)、單一集合(set)、字典(dict)和值組(tuple)。當不同型態需要應用時,必須先進行型態轉型。
此外,課程涵蓋了構成運算式的五大類運算子,核心包含指派、算數、比較和邏輯運算子。並展示了字串操作,如封裝、跳脫字元 (\n),以及使用內建方法 (如 strip(), split()) 處理文本。最終,學習者將掌握 print() 函式,並利用 C 語言相似的格式化字元、.format() 或 Python 3.6 之後的 f-string 進行格式化輸出。
This course focuses on the foundational core of Python programming: variables, data, operators, and output. Learners will understand that variables consist of a data type and a variable name, subject to naming rules like prohibiting reserved words. The content details Python's primary types, including Numeric, Boolean, String (str), and four Container Types: list, set, dictionary (dict), and tuple. Type conversion is necessary when applying different data types.
Furthermore, the material covers the five main operator categories used in expressions, primarily including assignment, arithmetic, comparison, and logical operators. It also demonstrates string operations, such as encapsulation, escape characters (\n), and text processing using built-in methods (e.g., strip(), split()). Finally, learners will master the print() function, utilizing C-style format characters, .format(), or the f-string method (Python 3.6+) for formatted output.