Horje
python class variables Code Example
python class variables
// no need to define variables explicitly like in java or c++
// we need to define them in __init__ method that creates, this i8s the key 
// __init__ basically it's constructor
// instance variables for the current object self( which denotes your created instance)
class A:
 def __init__(self,d):
     self.d=d
//above automaticaaly creates an instance variable d for you class object
hence 

ob=A(4)
// creates object ob with 1 instance variable d initialised to 4 

ALSO NOTE:
// in python there is no distinction between pointer variable and 
// normal variable we use same syntax for both unlike c++
// so how python distinguishes b/w a reference and normal var?
// by seeing what is being assigned to it on RHS




Python

Related
python outlook Code Example python outlook Code Example
pandas.describe per group Code Example pandas.describe per group Code Example
how to download multiple googel images using python Code Example how to download multiple googel images using python Code Example
setup mongodb database with django Code Example setup mongodb database with django Code Example
work day prior to date python Code Example work day prior to date python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7