In this we are going to see a basic program of multiple inheritance for vehicle class in Python Programming Language.
# Base class
class Water_Vehicle:
def Winfo(self):
print('Traverses on water')
class Road_Vehicle:
def Rinfo(self):
print('Traverses on road')
class Vehicle(Road_Vehicle,Water_Vehicle):
def info(self):
print("Can be a road or water vehicle")
veh = Vehicle()
veh.info()
veh.Winfo()
veh.Rinfo()
# Coded by SAAHIL
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP