Python Day 01 Basic Introduction of Python




Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language.
  • Python is dynamic typed programming language.
  • Python is a platform independent language.
  • Python is interpreted programming language.
  • Python is freeware and Open Source language.
  • Python is extensible language.

  1. ·         Functional programming languages has been borrowed from c
  2. ·         Object oriented programming concept has been borrowed from c++.
  3. ·         Script programming language concept from shell & Perl
  4. ·         Modular programming language from Modula-3

Note: - 
  • Most of the syntax has been borrowed from C and ABC language.
  • In Python we have 30 keywords although in java we have 53.
  • In Python we will not require to specify the type of variable
  • Python new version i.e. 3 does not support Python 2  i.e. for old version


Flavors of python
  • ·         CPython :- used to work with C language
  • ·         Jython :- used to work with Java language
  • ·         JPython :- used to work with Java language
  • ·         IronPython :-
  • ·         Pypy :- Inside Python machine we have JIT compiler to improve the performance
  • ·         RubyPython:- used to work with Ruby language
  • ·         AnacondaPython:- used to work with big data or Hadoop
  • ·         Stackless :- used to work in multi-threading environment



Python Versions
  • ·         Python 1.0 introduced in Jan 1994 (Obsolete)
  • ·         Python 2.0 introduced in Oct 2000
  • ·         Python 3.0 introduced in Dec 2008
      • Python 3.6.3 is the latest version introduced in 2016.


               
 =======================================================================

Basic Syntax  :- Copy the below code and try to run the same you will get some idea

======================================================================
print("Hello Python")

a,b,c =10,20,40
print(a+b)

print(type(a))

a=True
print(type(a))

def f1(): print("good day")

f1()

for i in range(5):
    print(i)
    
x= 10 if c>b else 20
print(x)

def f2():
    print("let test another functions" ,x)
    f1();
f2()

import math
print(math.sqrt(4))

from random import *
print(randrange(0,100000))
for i in range(10):
    print(randint(0,9),randint(0,9),randint(0,9),randint(0,9),randint(0,9),randint(0,9),sep="")
    





Post a Comment