GK SCIENTIST

General Knowledge One Stop Source
Menu
  • Home
  • Social Science
    • History
    • Political Science
    • Geography
  • Science
    • Physics
    • Chemistry
    • Biology
  • Chemistry Notes
  • Mathematics
  • Computer
  • Tutorial MySQL
  • Tutorial Python
  • Java Tutorial
  • English Grammar
  • English Essay
  • Indian Anthropology
  • Philosophy
  • Solved Paper
  • UPSC
  • Current Content
    • Current Affairs
    • RSTV News
    • Yojana and Kurukshetra Gist
  • Donate
  • Contact Us

If you are interested in advertising to our audience, submit the advertising enquiry form.

Advertising Enquiry
Computer

Python Inheritance

Gk Scientist December 5, 2022 No Comments
Tweet WhatsApp Telegram

Python Inheritance:

We can use the PyCharm code editor for this example. If you do not know about it then follow this link- How to install PyCharm for Python and create a program in it.

(1) Inheritance is a mechanism for creating a new class that specializes or modifies the behavior of an existing class. The original class is called a base class, superclass, or parent class. The new class is called a derived class or subclass or child class. When a class is created via inheritance, it “inherits” the attributes defined by its base classes. However, a derived class may redefine any of these attributes and add new attributes of its own.

(2) When there’s only one child class that inherits the features of its parent class, it is referred to as single inheritance as shown below.

single inheritance in python - Python Inheritance

(3) In multiple inheritance, a child class inherits the features of multiple parent classes as shown below.

multiple inheritance in python - Python Inheritance

(4) Multilevel inheritance is when we have a second child class that inherits the features of the first child class as shown below.

Multilevel inheritance in Python - Python Inheritance

(5) When we use one parent class to construct multiple subclasses we have the hierarchical inheritance.

(6) When we combine several types of inheritance we call it hybrid inheritance.


Object-Oriented Programming (OOP)
Computer Software and Hardware
Information and Communication Technology
C++ Data Types
Tokens in C++
Install MySQL on Windows
Inheritance (object-oriented programming)– Wikipedia
Prev Article
Next Article

Related Articles

Tuple in Python
Tuple in Python: We can use the PyCharm code editor …
Gk Scientist November 30, 2022 Computer

Tuple in Python

Python SQLite Insert Query
Python SQLite Insert Query: We can use the PyCharm code …
Gk Scientist December 8, 2022 Computer

Python SQLite Insert Query

Tokens in C++
Tokens in C++ Tokens may be defined as the smallest …
Gk Scientist September 12, 2022 Computer

Tokens in C++

Python Digital Clock Project
Python Digital Clock Project: We can use the PyCharm code …
Gk Scientist December 24, 2022 Computer

Python Digital Clock Project

How to Download and Install Chrome Browser on Windows
Download and Install Chrome Browser on Windows: Web Browser: A …
Gk Scientist January 29, 2023 Computer

How to Download and Install Chrome Browser on Windows

MySQL LIKE Operator
MySQL LIKE Operator: Example of MySQL LIKE Operator: Example of …
Gk Scientist November 14, 2022 Computer

MySQL LIKE Operator

How to Install PyCharm For Python on Windows
Install PyCharm For Python: (1) Many IDEs (Integrated Development Environment) …
Gk Scientist November 19, 2022 Computer

How to Install PyCharm For Python on Windows

Install Python on Windows
Install Python on Windows: (1) Go to your web browser …
Gk Scientist November 19, 2022 Computer

Install Python on Windows

Leave a Reply Cancel Reply

Search




  • Popular
  • Recent




GK SCIENTIST

General Knowledge One Stop Source

Information

  • About Us
  • Terms and Condition, Disclaimer
  • Contact Us

Android Apps

  • IAS App For English Medium Students
  • IAS Basics App For English Medium Students
  • IAS Hindi App For Hindi Medium Students
DMCA.com Protection Status

Popular Tags

Biology (33) Biology Questions (88) Chemistry (57) Computer (212) Current Affairs (4) Current Content (0) Economy (10) English Essay (172) English Grammar (75) English Literature (10) Geography (83) History (259) Indian Anthropology (11) Indian Polity (14) JKAS Mains Question Papers (17) Mathematics (68) Moral Science (7) NCERT & Other Boards Books (25) Philosophy (114) Physics (89) Political Science (132) RS TV News (33) Science (553) Social Anthropology (7) Social Science (17) Solved Paper (47) UPSC (7) UPSC Mains Question Papers (26)

Downloads

  • NCERT Books
  • Old NCERT Books
  • NIOS Books For IAS, SSC, and State PSC Exam
  • Tamil Nadu Board Books: Important For UPSC, SSC, and State PSC Exam
  • Modern Indian and World History Notes For IAS Exam
  • UPSC Topper 2013 Gaurav Agrawal Notes For IAS Preparation
  • UPSC IAS Prelims General Studies – Previous Year Papers
  • UPSC Mains Question Papers

Copyright © 2023 GK SCIENTIST
Theme by MyThemeShop.com& Hosted On Cloudways
 

Loading Comments...