SlideShare a Scribd company logo
PYTHON
PROGRAMING
SAMEER PATIL
INTRODUCTION
• C programing concern with functional aspect. We are concerning with writing code using
function.
• Programing will become easy if it based on real life example, hence they develop Object
Oriented Language like Java and .NET where programing done with Classes and Objects.
• Java Program to Write sum of two numbers
• C program to write sum of two numbers
• Python style
• a=b=10
• print(“sum”,(a+b))
HISTORY
• Python was developed by Guido Van Rossum in year 1991, at center for mathematics and
Computer science managed by Dutch Govt.
• Developer was working on project to develop system utilities in C where he had interact with
bourn shell available in UNIX.
• Python name appeared from the TV Show Monty Python’s Flying Circus
• Official launched on 20th Feb 1991.
• Python is Open Source.
FEATURES OF PYTHON
• Simple
• Easy to learn
• Open Source
• High level Language
• Dynamically Typed
• Platform Independence
• Portable
• procedure and Object oriented
• Simple-Python is simple programing Language .felt like reading English sentences. It means more
clarity and less stress on understating of syntax of language
• Easy to learn – uses very few keyword , program structure is simple. Similar to C programing .
Hence Migration from C to Python is easy for programmers.
• Open Source - easily available for download www.python.org
• High level Language – Similar to English Language , low level language Machine understandable
code.
• Dynamically Typed-in Python , we are not declaring anything.an assignment statement binds a
name to an objects can be of any type. If a name is assigned to an objects of one type, it may be later
be assigned to an objects of different type.
• >>>year = 2017
• >>> dec = 1.1
• >>> hello = 'Hello, World!'
• >>> alphabet = ['a','b','c']
• But what ‘types’ are these variables? Let’s use the types module to find out:
• >>> from types import *
• >>> type(year)
• <type 'int'>
• >>> type(dec)
• <type 'float'>
• >>> type(hello)
• <type 'str'>
• >>> type(alphabet)
• <type 'list'>
• As you can see, I didn’t have to tell Python what ‘type’ each variable value was, it assigned the
types dynamically
• Platform Independent-
• Portable
• Procedure and OOPS based.
• Class is collection of objects having similar attributes and operation.
• Python Packages –
• BOTO is amazon web services
• CherryPy is Object oriented HTTP framework
• Fiona reads and write big data files.
• Mysql-connector –python is driver written in python to connect to MySQL database
• Numpy-is a package for processing array of single or multidimensional type
• Pandas is package for powerful data structure for data analysis, time series and statistics
• Pillow is python imaging library.
• Pyquery represent jquery like library for python.
• W3lib is library of web related function.
EXECUTION OF PYTHON PROGRAM
• Python program can write in abc.py where abc is name of the program wheras .py is extension
name.
• Compile the program into python compiler.
• Byte code.
• Abc.pyc
• Pvm
• machinecode
• result
C VS PYTHON
C programing Python Programing
C program execute Faster Slower compared to C
Type Declaration Compulsory Not required
C language type discipline in static and weak Python type discipline is dynamic and Strong
Pointers available No Pointers
C ha s switch statements No switch statement
Memory allocation using malloc and calloc Memory allocation and Deallocation done by PVM
Procedural approch Oops based
JAVA VS PYTHON
JAVA PYTHON
Memory allocation and deallocation done by JVM PVM
Switch is allowed No switch
A semicolon is used to terminate the statement and
comma is used to separate expression.
New line indicate end of statement and semicolon is
used as an expression separator
Array index is positive integer Can be positive or negative.
Static and weak Dynamic and strong
Oops languages, functional programing used in java
8.0 in lamda expression
Oops language, blends functional programming with
lambda expression inbuild.
PVM
• Python source file converted in Byte Code format.
• Byte code represent the fixed set of instruction created by python developers representing all
types of operations.
• And store that file in .pyc extension
• Role of PVM to convert that byte code into machine understandable code, so that computer can
execute that machine code and display result.
• To carry out this conversion , byte code into machine code and sends that machine code to
computer processor for execution. Since Interpreter plays main role, often pvm also mention as
interpreter.
FROZEN BINARIES
• Frozen binary executables are packages that combine your program's byte code and the Python
interpreter into a single executable program. With these, programs can be launched in the same
ways that you would launch any other executable program (icon clicks, command lines, etc.).
• py2exe
MEMORY MANAGEMENT IN PYTHON
• Python , memory allocation and deallocation are done during runtime automatically.
• The programmer need not allocate memory while creating objects or deallocate memory when
deleting the objects. Python PVM take care of such issues.
• Everything is consider as an objects in Python. Example Strings are objects, list are objects ,
functions are objects.
• For every object, memory should be allocated .memory manager inside PVM allocates memory
required for the objects created in Python Programming .
• All these objects are stored on separate memory called Heap.
• Heap is memory which allocated during runtime.
GARBAGE COLLECTION IN PYTHON
• Python’s memory allocation and deallocation method is automatic.
• Python uses two strategies for memory allocation:
• Reference counting
• Garbage collection
• the Python interpreter only used reference counting for memory management. Reference counting
works by counting the number of times an object is referenced by other objects in the system. When
references to an object are removed, the reference count for an object is decremented. When the
reference count becomes zero, the object is deallocated.

More Related Content

What's hot

Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
pandas: Powerful data analysis tools for Python
pandas: Powerful data analysis tools for Pythonpandas: Powerful data analysis tools for Python
pandas: Powerful data analysis tools for Python
Wes McKinney
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Syed Zaid Irshad
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
St. Petersburg College
 
Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python
Jaganadh Gopinadhan
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
Kamal Acharya
 
Python Intro
Python IntroPython Intro
Python Intro
Tim Penhey
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Edureka!
 
Python
PythonPython
Python
SHIVAM VERMA
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda
 
Python
PythonPython
Python Presentation
Python PresentationPython Presentation
Python Presentation
Narendra Sisodiya
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
JanBask Training
 
Introduction to python 3
Introduction to python 3Introduction to python 3
Introduction to python 3
Youhei Sakurai
 
Python made easy
Python made easy Python made easy
Python made easy
Abhishek kumar
 

What's hot (20)

Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
pandas: Powerful data analysis tools for Python
pandas: Powerful data analysis tools for Pythonpandas: Powerful data analysis tools for Python
pandas: Powerful data analysis tools for Python
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
Python Intro
Python IntroPython Intro
Python Intro
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
 
Python
PythonPython
Python
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python
PythonPython
Python
 
Python Presentation
Python PresentationPython Presentation
Python Presentation
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
 
Introduction to python 3
Introduction to python 3Introduction to python 3
Introduction to python 3
 
Python made easy
Python made easy Python made easy
Python made easy
 

Similar to Introduction to Python Programing

Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
Python intro
Python introPython intro
Python intro
Piyush rai
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Mohammed Rafi
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
HassanShah396906
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
MaheShiva
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
Michael Hudson-Doyle
 
1-ppt-python.ppt
1-ppt-python.ppt1-ppt-python.ppt
1-ppt-python.ppt
ssusera99a83
 
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdfClass_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf
SanjeedaPraween
 
Python programming 2nd
Python programming 2ndPython programming 2nd
Python programming 2nd
Aishwarya Deshmukh
 
Python Programming.pdf
Python Programming.pdfPython Programming.pdf
Python Programming.pdf
ssuser9a6ca1
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
shetoooelshitany74
 
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Godwin585235
 
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
TIB Academy
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 

Similar to Introduction to Python Programing (20)

Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Python intro
Python introPython intro
Python intro
 
Python Module-1.1.pdf
Python Module-1.1.pdfPython Module-1.1.pdf
Python Module-1.1.pdf
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
 
1-ppt-python.ppt
1-ppt-python.ppt1-ppt-python.ppt
1-ppt-python.ppt
 
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdfClass_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf
 
Python programming 2nd
Python programming 2ndPython programming 2nd
Python programming 2nd
 
Python Programming.pdf
Python Programming.pdfPython Programming.pdf
Python Programming.pdf
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
 
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
 
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Introduction to Python Programing

  • 2. INTRODUCTION • C programing concern with functional aspect. We are concerning with writing code using function. • Programing will become easy if it based on real life example, hence they develop Object Oriented Language like Java and .NET where programing done with Classes and Objects. • Java Program to Write sum of two numbers • C program to write sum of two numbers • Python style • a=b=10 • print(“sum”,(a+b))
  • 3. HISTORY • Python was developed by Guido Van Rossum in year 1991, at center for mathematics and Computer science managed by Dutch Govt. • Developer was working on project to develop system utilities in C where he had interact with bourn shell available in UNIX. • Python name appeared from the TV Show Monty Python’s Flying Circus • Official launched on 20th Feb 1991. • Python is Open Source.
  • 4. FEATURES OF PYTHON • Simple • Easy to learn • Open Source • High level Language • Dynamically Typed • Platform Independence • Portable • procedure and Object oriented
  • 5. • Simple-Python is simple programing Language .felt like reading English sentences. It means more clarity and less stress on understating of syntax of language • Easy to learn – uses very few keyword , program structure is simple. Similar to C programing . Hence Migration from C to Python is easy for programmers. • Open Source - easily available for download www.python.org • High level Language – Similar to English Language , low level language Machine understandable code. • Dynamically Typed-in Python , we are not declaring anything.an assignment statement binds a name to an objects can be of any type. If a name is assigned to an objects of one type, it may be later be assigned to an objects of different type. • >>>year = 2017 • >>> dec = 1.1 • >>> hello = 'Hello, World!' • >>> alphabet = ['a','b','c']
  • 6. • But what ‘types’ are these variables? Let’s use the types module to find out: • >>> from types import * • >>> type(year) • <type 'int'> • >>> type(dec) • <type 'float'> • >>> type(hello) • <type 'str'> • >>> type(alphabet) • <type 'list'>
  • 7. • As you can see, I didn’t have to tell Python what ‘type’ each variable value was, it assigned the types dynamically • Platform Independent- • Portable • Procedure and OOPS based.
  • 8. • Class is collection of objects having similar attributes and operation. • Python Packages – • BOTO is amazon web services • CherryPy is Object oriented HTTP framework • Fiona reads and write big data files. • Mysql-connector –python is driver written in python to connect to MySQL database • Numpy-is a package for processing array of single or multidimensional type • Pandas is package for powerful data structure for data analysis, time series and statistics • Pillow is python imaging library. • Pyquery represent jquery like library for python. • W3lib is library of web related function.
  • 9. EXECUTION OF PYTHON PROGRAM • Python program can write in abc.py where abc is name of the program wheras .py is extension name. • Compile the program into python compiler. • Byte code. • Abc.pyc • Pvm • machinecode • result
  • 10. C VS PYTHON C programing Python Programing C program execute Faster Slower compared to C Type Declaration Compulsory Not required C language type discipline in static and weak Python type discipline is dynamic and Strong Pointers available No Pointers C ha s switch statements No switch statement Memory allocation using malloc and calloc Memory allocation and Deallocation done by PVM Procedural approch Oops based
  • 11. JAVA VS PYTHON JAVA PYTHON Memory allocation and deallocation done by JVM PVM Switch is allowed No switch A semicolon is used to terminate the statement and comma is used to separate expression. New line indicate end of statement and semicolon is used as an expression separator Array index is positive integer Can be positive or negative. Static and weak Dynamic and strong Oops languages, functional programing used in java 8.0 in lamda expression Oops language, blends functional programming with lambda expression inbuild.
  • 12. PVM • Python source file converted in Byte Code format. • Byte code represent the fixed set of instruction created by python developers representing all types of operations. • And store that file in .pyc extension • Role of PVM to convert that byte code into machine understandable code, so that computer can execute that machine code and display result. • To carry out this conversion , byte code into machine code and sends that machine code to computer processor for execution. Since Interpreter plays main role, often pvm also mention as interpreter.
  • 13. FROZEN BINARIES • Frozen binary executables are packages that combine your program's byte code and the Python interpreter into a single executable program. With these, programs can be launched in the same ways that you would launch any other executable program (icon clicks, command lines, etc.). • py2exe
  • 14. MEMORY MANAGEMENT IN PYTHON • Python , memory allocation and deallocation are done during runtime automatically. • The programmer need not allocate memory while creating objects or deallocate memory when deleting the objects. Python PVM take care of such issues. • Everything is consider as an objects in Python. Example Strings are objects, list are objects , functions are objects. • For every object, memory should be allocated .memory manager inside PVM allocates memory required for the objects created in Python Programming . • All these objects are stored on separate memory called Heap. • Heap is memory which allocated during runtime.
  • 15. GARBAGE COLLECTION IN PYTHON • Python’s memory allocation and deallocation method is automatic. • Python uses two strategies for memory allocation: • Reference counting • Garbage collection • the Python interpreter only used reference counting for memory management. Reference counting works by counting the number of times an object is referenced by other objects in the system. When references to an object are removed, the reference count for an object is decremented. When the reference count becomes zero, the object is deallocated.