Using Python pass Keyword during Data Abstraction - 2 || Data Abstraction || Python 

In this we are going to see a program about Using Python 'pass' Keyword during Data Abstraction - Type 2 in Python Programming Language.


class Vehicle:
    def tires(self):
        pass


class Car(Vehicle):
    def tires(self):
        print("I have 4 tires")


class Rickshaw(Vehicle):
    def tires(self):
        print("I have 3 tires")


class Bike(Vehicle):
    def tires(self):
        print("I have 2 tires")


c = Car()
c.tires()

r = Rickshaw()
r.tires()

b = Bike()
b.tires()

# Coded by Saahil

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post