Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e2779ab

Browse files
author
Rai Muhammad Haider
committed
2 parents 6ab8811 + b495733 commit e2779ab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎Oops.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ def fule_type(self): # polymorphism
115115
# print(new_car.Model)
116116
# print(car.car_info())
117117
my_tesla = Electric_Car('Tesla', 'Model S' , '39KWh')
118+
# Multiple Inheritance
119+
class Engin:
120+
def car_Engin(self):
121+
return 'Car Engine is Electric'
122+
class Bettery:
123+
def car_bettery(self):
124+
return 'Car bettery is leathum'
125+
class Electric_car_Model(Engin , Bettery , Car):
126+
pass
127+
new_tesla_car = Electric_car_Model('Tesla','T Shap')
128+
print(new_tesla_car.car_bettery())
129+
print(new_tesla_car.fule_type())
130+
print(new_tesla_car.car_info())
118131
# print(my_tesla.brand)
119132
# print(my_tesla.car_info())
120133
# print(my_tesla.get_brand())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /