๐งช ็ปงๆฟไธๅคๆ
โฑ๏ธ 25-30 min๐ Intermediate
main.py
Costs 1 credit
ๅ ่ฝฝ็ผ่พๅจไธญ...
่พๅบ Outputๆง่กๆๅ
# ่ฟ่กไปฃ็ ๅ๏ผ่พๅบๅฐๆพ็คบๅจ่ฟ้ # ๆ Ctrl+Enter ๅฟซ้่ฟ่ก
Terminal (Simulated)Install commands are simulated only, no real network requests
$
Step 1: ๅบๆฌ็ปงๆฟ
็ปงๆฟ่ฎฉๅญ็ฑป็ดๆฅๆฅๆ็ถ็ฑป่ฝๅ๏ผๅๅฐ้ๅคๅฎไนๅฑๆงๅๅบ็กๆนๆณใ
ๅบๅฑ้ป่พ๏ผ
ๅ ๆญคๅญ็ฑปๅชๆไธๅ
class Dog(Animal) ไผๅปบ็ซ็ฑปๅๅฑ็บง๏ผDog ๅฎไพๅจๆพไธๅฐๆๅๆถไผๅ Animal ๆฅๆพใๅ ๆญคๅญ็ฑปๅชๆไธๅ
speak๏ผไน่ฝ่ฐ็จ็ถ็ฑป็ๆฌใ
ไฝ ็ไปปๅก๏ผ
- ๅๅปบ็ถ็ฑป
Animal๏ผๆnameๅฑๆงๅspeak()ๆนๆณ๏ผ่พๅบ "..."๏ผ - ๅๅปบๅญ็ฑป
Dog(Animal)๏ผ็ปงๆฟ Animal - ๅๅปบ Dog ๅฎไพๅนถ่ฐ็จ speak()
Self-Check List
- ๅๅปบๅบๆฌ็็ปงๆฟๅ ณ็ณป
Transfer Template
class Animal:
def __init__(self, name):After completing this step, you should be able to independently explain and reproduce this concept, then apply it to similar problems.