類別與 DRY 原則

Python 的軟體工程原則

Adam Spannbauer

Machine Learning Engineer at Eastman

建立 SocialMedia 類別

  社群媒體類別檔

Python 的軟體工程原則

DRY 原則

DRY 雨傘

Python 的軟體工程原則

DRY 原則

DRY 雨傘

Python 的軟體工程原則

DRY 原則

DRY 雨傘

Python 的軟體工程原則

DRY 原則

DRY 雨傘

Python 的軟體工程原則

繼承入門

  繼承自 Document 類別

Python 的軟體工程原則

Python 的繼承

繼承結構

Python 的軟體工程原則

Python 的繼承

# Import ParentClass object
from .parent_class import ParentClass

# Create a child class with inheritance class ChildClass(ParentClass): def __init__(self): # Call parent's __init__ method ParentClass.__init__(self)
# Add attribute unique to child class self.child_attribute = "I'm a child class attribute!"
# Create a ChildClass instance child_class = ChildClass() print(child_class.child_attribute) print(child_class.parent_attribute)
Python 的軟體工程原則

一起來練習吧!

Python 的軟體工程原則

Preparing Video For Download...