Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #تعدد الاشكال في البايثون
- class beko:
- def hi(self):
- print("beko")
- class bekoo:
- def hi(self):
- print("bekoo")
- class bekooo:
- def hi(self):
- print("bekooo")
- def v(g):
- g.hi()
- b1=beko()
- b2=bekoo()
- b3=bekooo()
- v(b1)
- print("_________________")
- v(b2)
- print("_________________ ")
- v(b3)
- #تعدد الاشكال هو استخدام نفس الدالة بنغس الاسم في كذا كلاس
- #واستخدام دالة واحد لتنفيذ كل الدوال المشتركة ف الاسم
Advertisement
Add Comment
Please, Sign In to add comment