- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop4.py
More file actions
Latest commit
32 lines (21 loc) · 492 Bytes
/
Copy pathoop4.py
File metadata and controls
32 lines (21 loc) · 492 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
classVehicle:
def__init__(self, brand, model):
self.brand=brand
self.model=model
defmove(self):
print("Move!")
classCar(Vehicle):
pass
classBoat(Vehicle):
defmove(self):
print("Sail!")
classPlane(Vehicle):
defmove(self):
print("Fly!")
car1=Car("Maruti", 2005)
boat1=Boat("ABCBoat", 2012)
plane1=Plane("Airbus", 2020)
forxin(car1, boat1, plane1):
print(x.brand)
print(x.model)
x.move()