Python Programming Language | Basics for beginners

History of Python 

Guido Van Rosem
                 Python was started in the since 1980 by Guido Van Rosem at Centrum Wiskunde & Informatica (CWI) within Netherlands as a successor to the ABC language (itself inspired by SETL), capable of exception handling and interfacing with the Amoeba OS. it had been created and first released on February 20, 1991 and developed by Python Software Foundation.Python language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.It is design philosophy emphasizes code readability with its notable use of great whitespace.

                  Python is an open source programming language that became very popular in the 2010s and is being used for many different purposes. It versatility as a language of choice for various software platforms like – data anlysis, data processing and Web Applications,Desktop GUI Applications,Software Development,Scientific and Numeric,Business Applications,Console Based Application,Audio or Video based Applications,3D CAD Applications,Enterprise Applications,Applications for Images etc indicates its flexibility.This programming language has been shown in the top 5 after research of many industry from 2015 onwards.

                   It was mainly developed for emphasis on code readability with Easy to learn and Use, and its syntax allows programmers to precise concepts in fewer lines of code.

The Python version release dates are as following below.

Python VersionsReleased Date
Python 1.0
January 1994
Python 1.5
December 31, 1997
Python 1.6
September 5, 2000
Python 2.0
October 16, 2000
Python 2.1
April 17, 2001
Python 2.2
December 21, 2001
Python 2.3
July 29, 2003
Python 2.4
November 30, 2004
Python 2.5
September 19, 2006
Python 2.6
October 1, 2008
Python 2.7
July 3, 2010
Python 3.0
December 3, 2008
Python 3.1
June 27, 2009
Python 3.2
February 20, 2011
Python 3.3
September 29, 2012
Python 3.4
March 16, 2014
Python 3.5
eptember 13, 2015
Python 3.6
December 23, 2016
Python 3.7
June 27, 2018


What is Python?                 

                      Python is an object-oriented,high-level program,interpreted programing language with high dynamic semantics.Python supports modules and packages, which inspires program modularity and code reuse. In inbuilt data structures, combined with dynamic binding,make it very attractive for Fast Application Development, also on be used as a scripting or adhesive language to connect existing components together. It is simple, easy to find out syntax emphasizes readability and thus reduces the value of program maintenance. Python is interpreter and therefore the extensive standard library are available in source or binary form for all major platforms, and may be freely distributed.


Python Features

  • Easy to Learn and Use
  • Expressive Language
  • Interpreted Language
  • Cross-platform Language
  • Free and Open Source
  • Object-Oriented Language
  • Extensible
  • Large Standard Library
  • GUI Programming Support
  • Integrated
  • Dynamically 
  • Support for Other Languages
  • Highly Portable


Python OOPs(Object Oriented Programming System) Concepts

  • Object : It is an instance of a Class. An object consists of State,Behavior and Identity.
           Basic Syntax - Example :
              
                class MyClass:
                a = 3

                obj = MyClass()
                print(obj.a)

  • Class : It is for defining a particular type of object. And created by the keyword class.
                Basic Syntax - Example :
              
                class MyClass:
                a = 3

                print(MyClass)
               
  • Method : A method in python is somewhat almost like a function, except it's related to object/classes.It can operate the info (instance variables) that's contained by the corresponding class.The method is implicitly used for an object that it's called.
          Basic Syntax - Example :
        
            class Pet(object):
            def my_method(self):
            print("I am a Cat")
            cat = Pet()
            cat.my_method()

  • Inheritance : Inheritance is define a category that inherits all the methods and properties from main class. The new class is named derived (or child) class and therefore the one from which it inherits is named the base (or parent) class.
          Basic Syntax - Example :
           
            class Person:
            def __init__(self, fname, lname):
            self.firstname = fname
            self.lastname = lname

           def printname(self):
           print(self.firstname, self.lastname)

           class Student(Person):
           pass

           x = Student("Vikram", "Parmar")
           x.printname()

  • Polymorphism : Polymorphism is extremely useful because it makes programming more intuitive and thus easier. It's defines the power to require different forms. In Python allows us to define methods within the child class with an equivalent name as defined in their parent class. Polymorphism enables employing a single interface with input of various datatypes, different class or could also be for various number of inputs.
          Basic Syntax - Example :

             class Bird:
             def intro(self): 
            print("There are many types of birds.") 
             def flight(self): 
            print("Mostly birds can fly but some cannot.") 
             class sparrow(Bird): 
             def flight(self): 
             print("Sparrows can fly.") 
             class ostrich(Bird): 
             def flight(self): 
            print("Ostriches cannot fly.") 
            obj_bird = Bird() 
            obj_spr = sparrow() 
            obj_ost = ostrich() 

            obj_bird.intro() 
            obj_bird.flight() 

            obj_spr.intro() 
            obj_spr.flight() 

           obj_ost.intro() 
           obj_ost.flight() 

  • Data Abstraction : Abstraction means hiding the complexity and only showing the essential features of the object.Data abstraction is analogous in character to functional abstraction.The other fundamental way we abstract is through data abstraction. Just as there are related program statements that can bundled together, there are also related program variables that can be bundled together. Such abstractions allow us to think of the data within a program hierarchically.
          Basic Syntax - Example :

             from abc import ABC, abstractmethod
             class Payment(ABC):
             def print_slip(self, amount):
             print('Purchase of amount- ', amount)
             @abstractmethod
             def payment(self, amount):
              pass

             class CreditCardPayment(Payment):
             def payment(self, amount):
              print('Credit card payment of- ', amount)

              class MobileWalletPayment(Payment):
             def payment(self, amount):
              print('Mobile wallet payment of- ', amount)

              obj = CreditCardPayment()
              obj.payment(100)
              obj.print_slip(100)
              print(isinstance(obj, Payment))
              obj = MobileWalletPayment()
              obj.payment(200)
              obj.print_slip(200)
              print(isinstance(obj, Payment))

  • Encapsulation : The concept of Encapsulation is to keep together the implementation and therefore the data it manipulates.In Python is that the process of wrapping up variables and methods into one entity.This puts restrictions on accessing variables and methods directly and may prevent the accidental modification of knowledge . It are often achieved by declaring the info members of a category either as private or protected.
          Basic Syntax - Example :

           class Robot(object):
           def_init_(self):
           self.__version = 22

          def getVersion(self):
          print(self.__version)

          def setVersion(self, version):
          self.__version = version

          obj = Robot()
          obj.getVersion()
          obj.setVersion(23)
          obj.getVersion()
          print(obj.__version


Types of Python Frameworks 

  • Full-Stack Framework 
  • Microframework
  • Asynchronous Framework 
  • AIOHTTP 
  • Bottle 
  • BlueBream 
  • Bobo 
  • CherryPy 
  • CubicWeb
  • Dash 
  • Django 
  • Falcon 
  • Flask 
  • Giotto 
  • Growler 
  • Hug 
  • MorePath 
  • Pycnic 
  • Pylons Framework 
  • Pyramid 
  • Sanic 
  • Tornado 
  • TurboGears 
  • Quixote 
  • Nevow 
  • Ray
  • Web2Py

Python Editor Tools - Download on Click Here 

  • IDLE
Download : Click Here

  • Atom/Atom-IDE
Download : Click Here

  • Sublime Text 3        
Download : Click Here