Skip to main content

Posts

Showing posts with the label Python Advanced

Python 學習大綱:進階篇

一、物件導向程式設計 (OOP) 學習目標:  - 理解物件導向程式設計的概念和優勢。 - 掌握類別、物件、繼承、多型等 OOP 的核心要素。 - 能夠使用 OOP 的方法設計和開發 Python 程式。 內容: 1. OOP 簡介:      - 什麼是物件導向程式設計? 優點與缺點。     - 程序式程式設計 vs. 物件導向程式設計。 2. 類別和物件:     - 定義類別和建立物件。     - 類別屬性和實例屬性。     - 類別方法和實例方法。 3. 繼承和多型:     - 繼承的概念和語法。     - 方法覆蓋和多型。 4. 封裝和資訊隱藏:     - Getter 和 Setter 5. OOP 設計原則:     - SOLID 原則:     - 單一職責原則(Single responsibility principle, SRP)     - 開放封閉原則(Open-Close principle, OCP)     - 里氏替換原則(Liskov substitution principle, LSP)     - 接口隔離原則(Interface segregation principle, ISP)(會省略)     - 依賴反轉原則(Dependency inversion principle, DIP)     - 設計模式     - Factory Pattern     - Singleton Pattern 二、進階函數式程式設計 使用進階函數式簡化程式碼,提高程式效率。      - map、filter、reduce 等進階函數的使用。      - lambda 匿名函數 三、decorator(裝飾器)      - decorator使...