Overview of python programming/Element of python

               Overview of programming :

* What is python :-  python is an interpreted,Object oriented high level programming language with dynamic symantics. It is high level built in data structure combine with dynamic  typing and dynamic building make it every alternative for rappid application

development.

* structure of python program :-

programming structure in python, in general python program consist of so many text files.Which contents python statements . Program is designed as single man, high file with one or more  sepliment files . Such as python online course . In python high level file has important path of control of your program file . You can start your program. The library tools are also known as module files.

* Elements of python :

There are several types of elements in python programming that are shown as -

1. Source code
2. Data types
3. List and Indends
4. Concept of object
5. Oops concept

1. Source code -:-  

In computing source code is only collection of code.  Whose code written using the human readable programming language that is called source code. The source code of a program is specially designed to failitate the work of computer program. Who specify the actions to be performed by computer mostly writing the source code . The source is often transformed by an assembler and compiler into binary machine to understood by the computer .


2. Data types -:-  

variables can store values of different data types . Python is a dynamically programming language hence we need not define the types of variable while declare it.  In python programming language python interpreter is automatically understand data types and store values in the variables.


Example :

 Output :


3. List and Indends -:-


List:-  List is a type of container in the data structure which is used to store multiple value at the same time. In the list we can separate value with the comma. And declare in the square bracket. List is also store values different types at the same time such as number value and string value etc.
Example :


Output :


Indends :-  

Almost every programming language uses the curly brasses {} to define the code of block but in the python program support indentation. That means when we define a function, class or any condition statement ect than it's starting with indentation. A indentation is a blank space.
Example :
Output :


4. Concept of object :-  

 python is an object oriented programming language A object is a same work like variables but variable store only one value at a time, and object is store multiple values at the same time. And objects created  using the class name. A class has one or more objects with different name of object .

Example :
5.oops concept :- 

oops is full name object oriented programming system . In python programming language oops concept have several types that are shown as -

1. Class
2. Object
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
7. Message passing

1. Class :-  class is a user  define data type which holds it's own data member and member function.  Which can be accessed and used by reading an instance of that class. A class is like a blue print of an object. And class is defined using with class keyword.
Syntax :-     class  classname :

2. Object:-  An object is a instance of an class and create a memory for store values of variable.  When we define a class then class has no memory is allocated.
Syntax :-   objectname= classname ()

3. Inheritance :- inheritance is a most important concept in the object oriented programming. When we can be describe as a process of creating new classes from existing class. And class inherits some of the property and behavior of the existing class. An  existing class is denote parent class and new class is denote base class .

Types of inheritance :-  there are three types of inheritance :

1. Single inheritance
2. Multiple inheritance
3. Multi level inheritance

1. Single inheritance :-

In single inheritance has only one base class or one derived class and one class inherits properties of only one class.
Example : 

Class myclass:
           Fname="  "
           Lname="  "
              def show(self):
                     Print(self.Fname)
     Class myclass1(myclass):
               def display(self):
                    Print(self.Lname)
              Obj=myclass1()
           Obj. Fname="kamini"
           Obj. Lname="Rahul"
         Obj. Show()
        Obj. Display()

2. Multiple inheritance :-   

multiple inheritance represent a kind of inheritance when a derived class inherits properties of multiple classes.
Example : 

Class A:
           def show(self):
                Print("class A")
 Class B:
           def ShowB (self) :
                 Print("class B")
Class C(A ,B) :
          def showC(self):
               Print("class C")
Obj= C()
Obj.show()
Obj.ShowB()
Obj.ShowC()


3. Multi level inheritance :-

multi level inheritance represent a type of inheritance when a derived class is a base class for another  class.
Example :   

Class A:
           def show(self):
                Print("class A")
 Class B(A):
           def ShowB (self) :
                 Print("class B")
Class C(B ):
          def showC(self):
               Print("class C")
Obj= C()
Obj.show()
Obj.ShowB()
Obj.ShowC()

4. Polymorphism:- 

In the polymorphism we can define one or more function from the same name but every function  has taken different type argument. If you want to take the same name in your program then you use the polymorphism concept.
Example : 
  class A:
             def show(self):
                  Print("it is class A")
Class B:
            def show(self):
                  Print("it is class B")
Obj=A()
Obj1=B()
Obj. Show()
Obj. Show()

5.  Abstraction:-   An abstraction is one of the most essential and important feature of the oops in python programming. Abstraction means display only essential information about the outside world hiding the background details or implementation.

6.  Encapsulation :-   

An encapsulation is a process of combining data member and function in a single unit called class.  This is to prevent the access to the data directly.  The access to them is provided through the functions of the class.

7.  Message passing :-  message passing is a type of communication between process. Message passing is a form of communication used used in parallel programming and oops.  Communications  are completed by the sending of messages to recipients.
        

No comments:

Post a Comment

Comments in python

            What is comment : When are you writing programming  code,  sometimes have to tell about some statements and functions, then y...