B 計算機編碼教程第 1 卷

Python 物件導向程式設計 (OOP) 學院

🐍 Python 物件導向程式設計 (OOP) 學院

30 分鐘互動式程式設計課程

經驗值 0/500
20%

第 1 課:建立課程

類別是物件的藍圖。

例如

class Dog:
    pass

Challenge: Create a class called Dog.

Lesson 2 – Creating Objects

Create an object named my_dog from the Dog class.

Lesson 3 – Constructors

Create an __init__ method with a name parameter.

Lesson 4 – Methods

Create a bark() method.

Lesson 5 – Inheritance

Create a Dog class that inherits from Animal.

🏆 Congratulations!

You completed the Python OOP Academy.

Topics Mastered:

  • Classes
  • Objects
  • Constructors
  • Attributes
  • Methods
  • Inheritance

Final Score: XP