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

Polymorphism in Python

Gk Scientist December 6, 2022 No Comments
Tweet WhatsApp Telegram

Polymorphism in Python:

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) Polymorphism is an important feature of the class definition in Python that is utilized when you have commonly named methods across classes or subclasses. This allows functions to use objects of any of these polymorphic classes without needing to be aware of distinctions across the classes. Polymorphism can be carried out through inheritance, with subclasses making use of base class methods or overriding them.

python polymorphism - Polymorphism in Python

In the above example, we have used the same len function containing different data types i.e. list and string. That’s why it is called Polymorphism.

Important Concepts of Polymorphism in Python:

(2) Method or Function Overloading- In Python, you can create a method/function that can be called in different ways. So, you can have a method that has zero, one, or more number of parameters. Depending on the method definition, we can call it zero, one, or more arguments. Given a single method or function, the member of parameters can be specified by you. This process of calling the same method in different ways is called method function overloading.

python function overloading - Polymorphism in Python

(3) Method or Function Overriding- It is an ability of any object-oriented programming language that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its superclasses or parent classes. When a method in a subclass has the same name, the same parameters or signature, and the same return type (or sub-type) as a method in its superclass, then the method in the subclass is said to override the method in the superclass.

method overriding in python - Polymorphism in Python
overriding in python - Polymorphism in Python

MySQL Inner Join
MySQL Left Join and Right Join
Natural Language Processing (NLP)
What is Virtual Reality?
Operating System as a Resource Manager
Multimedia and Its Application
Inheritance (object-oriented programming)– Wikipedia
Prev Article
Next Article

Related Articles

Install DB Browser for SQLite on Windows
DB Browser for SQLite: (1) Go to Google chrome and …
Gk Scientist December 7, 2022 Computer

Install DB Browser for SQLite on Windows

How to Create List in Python
Create List in Python: We can use the PyCharm code …
Gk Scientist November 27, 2022 Computer

How to Create List in Python

Internet and Its Uses
Internet: Nowadays, the Internet has become an integral part of …
Gk Scientist September 14, 2022 Computer

Internet and Its Uses

Python MySQL Update Query
Python MySQL Update Query: (1) Update query is used to …
Gk Scientist December 13, 2022 Computer

Python MySQL Update Query

Create MySQL Database and Connection in Python
Create MySQL Database and Connection in Python: In the previous …
Gk Scientist December 11, 2022 Computer

Create MySQL Database and Connection in Python

MySQL Insert Query (Single Row and Multiple Row)
MySQL Insert Query: (1) In the previous blog, we learn …
Gk Scientist November 11, 2022 Computer

MySQL Insert Query (Single Row and Multiple Row)

How to Solve JOptionPane error in Eclipse
Solve JOptionPane error in Eclipse: (1) Error while importing library …
Gk Scientist December 30, 2022 Computer

How to Solve JOptionPane error in Eclipse

Python Datetime Module
Python Datetime Module: We can use the PyCharm code editor …
Gk Scientist December 3, 2022 Computer

Python Datetime Module

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

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
 

Loading Comments...