Python OOPS
OOPs is a way of organizing code that uses objects and classes to represent
real-world entities and their behavior. In OOPs, object has attributes thing that
has specific data and can perform certain actions using methods.
OOPs Concepts in Python
Class in Python
Objects in Python
Polymorphism in Python
Encapsulation in Python
Inheritance in Python
Data Abstraction in Python
Python Class
A class is a collection of objects. Classes are blueprints for creating objects. A
class defines a set of attributes and methods that the created objects
(instances) can have.
Some points on Python class:
Classes are created by keyword class.
Attributes are the variables that belong to a class.
Attributes are always public and can be accessed using the dot (.) operator.
Example: Myclass.Myattribute
Python Objects
An Object is an instance of a Class. It represents a specific implementation of
the class and holds its own data.
An object consists of:
State: It is represented by the attributes and reflects the properties of an
object.
Behavior: It is represented by the methods of an object and reflects the
response of an object to other objects.
Identity: It gives a unique name to an object and enables one object to
interact with other objects.
OOPs is a way of organizing code that uses objects and classes to represent
real-world entities and their behavior. In OOPs, object has attributes thing that
has specific data and can perform certain actions using methods.
OOPs Concepts in Python
Class in Python
Objects in Python
Polymorphism in Python
Encapsulation in Python
Inheritance in Python
Data Abstraction in Python
Python Class
A class is a collection of objects. Classes are blueprints for creating objects. A
class defines a set of attributes and methods that the created objects
(instances) can have.
Some points on Python class:
Classes are created by keyword class.
Attributes are the variables that belong to a class.
Attributes are always public and can be accessed using the dot (.) operator.
Example: Myclass.Myattribute
Python Objects
An Object is an instance of a Class. It represents a specific implementation of
the class and holds its own data.
An object consists of:
State: It is represented by the attributes and reflects the properties of an
object.
Behavior: It is represented by the methods of an object and reflects the
response of an object to other objects.
Identity: It gives a unique name to an object and enables one object to
interact with other objects.