• Python is object oriented program
  • Object consists of two things (i) Data (ii) Methods
  •  

     

  • Class definition starts with CLASS key word
  •  

     

    what is __Init__

     

  • __init__
  •  

     

    what is self

     

  • Self denotes about current class
  •  

     

    Syntax for constructor

     

     

    Create Class:

     

     

     

    Object Oriented Programming Language

     

  • Languages which uses Classes and Objects in their program called Object Oriented Programming Languages
  •  

  • In this process Primary task sun-divides into multiple sub tasks
  •  

  • OOPS concept considers everything as object
  •  

     

  • Each sub class is termed as Class
  •  

    What is meant by Method:

     

     

    Features of Object Oriented Program:

  • Encapsulation
  • Abstraction
  • Inheritence
  • Polymorphism
  •  

     

    OOPS Encapsulation

     

  • All the program resides with in a class
  •  

     

    Variables and Methods of class:

  • All the variables and Methods bind together within the class
  • These variables and methods termed as Members of class
  •  

     

  • We can define variables and methods outside of the class also: which is termed as PUBLIC
  • As each object consists of different MEMORY ADDRESS encapsulation isolates the objects from one class to another
  • Consequently, we can define same members in different classes
  •  

     

    Inheritance

     

     

  • Inheritance is the process, which allows to create new class by retrieving Methods and variables from parent calss
  •  

  • In the below mentioned example parent class CALCULATION method has been executed in SUBCLASS
  •  

     

     

    Polymorophism

     

     

  • It enables to perform same method for different operations
  •