โดย Four » 26/01/2018 3:41 pm
ตัวอย่างการใช้งาน ฟังก์ชั่น super ใน การเขียน Python แบบ OOP
โค้ด: เลือกทั้งหมด
class test():
def __init__(self):
print("mindphp")
def fa(self):
print("python")
class test2(test):
def __init__(self):
print("odoo")
super(test2, self).fa()
test2()
ผลรัน
ศึกษาข้อมูลมาจาก :
https://www.youtube.com/watch?v=8_fOjTX ... lzdKrpxsMM
ตัวอย่างการใช้งาน ฟังก์ชั่น super ใน การเขียน Python แบบ OOP
[code]class test():
def __init__(self):
print("mindphp")
def fa(self):
print("python")
class test2(test):
def __init__(self):
print("odoo")
super(test2, self).fa()
test2()[/code]
[b]ผลรัน[/b]
[img]http://snap.mindphp.com/index.php?view=2018Jan26_5a6ae699ba2f1[/img]
ศึกษาข้อมูลมาจาก : https://www.youtube.com/watch?v=8_fOjTXyL8M&index=51&list=PLLi1ciqQAf8TVFbJpl7XY23lzdKrpxsMM