Object oriented programming in Python

 

Object oriented programming in python


Python is a multi-paradigm programming language. It supports several programming methodologies.

Creating objects is one of the most common ways to programming problems. This technique is called Object-Oriented Programming (OOP).

A thing has two characteristics:

characteristics

behaviour

Consider this example:

A parrot is an object because it has the following attributes:

name, age, and colour as traits

singing, dancing as behaviour

Python's OOP philosophy focuses on generating code that can be reused. This idea is commonly referred to as DRY (Don't Repeat Yourself).







No comments

Thanks for commenting. Keep connected.

Powered by Blogger.