Oops In Python
Class is a blueprint, plan, design, or model which contains full information about something.
Three Important things In Oops:
Class:
- Class is a Blueprint or a model which contains full information about something.
- what is the need for classes? : To create an object we need a class
Object:
- The physical existence of a class is nothing but an object. (because if you don't want an object there is no need to create a class)
- In programming, we can add functionality by using objects.
Reference Variable:
- Reference variables are to reference objects, by using reference variables we can invoke the functionality of the object.
- For a single object, there can be changes in multiple references.
To create a class :
class < Name_of_the_class >:
# In oops name of the class always starts with a capital letter.
* """ Document_string""" # It is to give an idea about a particular class and it's functionality.
Get Rajat Singh’s stories in your inbox
Join Medium for free to get updates from this writer.
* Properties (we can define by using variables)* Actions (we can add some functionality! What an object can perform by using methods)
- Every class has properties and behavior
- Properties (data) are specified by variable.
- Behavior is specified by methods
- Types of variables in Object-oriented-programing.
- Instance variable (Object level variable)
- Static variable ( Class level variable)
- local variable (Method level variable)
- Three types of methods in python Class.
- Instance method
- Class methods
- Static method
Self Keyword:
- The first parameter of a method or a class is generally referred to as a self.
- Self refers to the calling object. That is Jessa above.
- This argument is implicitly passed by the python interpreter and need not be mentioned while calling.
Class variable:
Class variables are something that is defined inside a class. Not in method Not even in the default method which is __init__.
Instance variable:
Instance variables are something that is defined inside a Constructor method(Function).







