In this we are going to see a program of transport class using hierarchical inheritance in Python Programming Language.
class transport:
def trans(self):
print("Reach a destination far away")
class Walk(transport):
def walk(self):
print("Location can walked to")
class Water_Vehicle(transport):
def Winfo(self):
print('Traverses on water')
class Road_Vehicle(transport):
def Rinfo(self):
print('Traverses on road')
w = Water_Vehicle()
r = Road_Vehicle()
w.Winfo()
r.Rinfo()
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP