help4code-logo
  • eLearning
    • Tutorials
    • Programs
    • Interview Questions
    • Technical Questions
    • C Language
    • C++
    • JAVA
    • HTML & CSS
    • PHP
    • AJAX
    • J2EE
    • SQL
    • jQuery
  • Go back to Home
  • Our Placements
  • Tutorials
  • Programs
  • Interview Questions
  • Technical Questions
  • Live Training
  • Our Placements
  • Associated Colleges
  • Our Recruiters
  • Back
  • C Language
  • C++
  • JAVA
  • HTML & CSS
  • PHP
  • AJAX
  • J2EE
  • SQL
  • jQuery

Programs

  1. Home
  2. Programs
  3. Python
  4. Inheritance
Image

Programs - Python - Inheritance

  • Programs
    • WAP to demonstrate single level inheritance in python
    • WAP to show employee details using single inheritance
    • WAP to demonstrate multilevel inheritance
    • WAP to show employee details using multilevel inheritance
    • WAP to demonstrate multiple inheritance
    • WAP to show employee details using multiple inheritance
    • WAP to demonstrate hierarchical inheritance
    • WAP to show employee details using hierarchical inheritance
    • WAP to demonstrate hybrid inheritance
    • WAP to show employee details using hybrid inheritance

Program:

class Animal:
def speak(self):
print("Animal Speaking")


# child class Dog inherits the base class Animal
class Dog(Animal):
def bark(self):
print("dog barking")


d = Dog()
d.bark()
d.speak()

Output:

dog barking
Animal Speaking
Help4Code

The help4code.com - An e-learning educational website where all computer science students can find rich collection of computer language programs which will help in exploring computer programming.

  • About
  • Associated Colleges
  • Leadership
  • Careers
  • Our Recruiters
  • Community
  • Terms
  • Privacy
  • Help
  • Press
  • Contact
  • Directory

First Floor, Plot No. 4, Near Shat Ayu College, Ring Road Nagpur, Maharashtra, India - 440022
+91 9175287066[email protected]

© Copyright 2022 help4code.com.

  • My Account
  • Sign-in
  • Sign-up