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).
Post a Comment