SlideShare a Scribd company logo
2
Most read
14
Most read
15
Most read
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 (20)

PPTX
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
PPTX
Introduction to Data Engineering
Vivek Aanand Ganesan
 
PDF
Introduction to Python for Data Science
Arc & Codementor
 
PDF
Python Basics | Python Tutorial | Edureka
Edureka!
 
PPTX
Exploratory Data Analysis using Python
Shirin Mojarad, Ph.D.
 
PPTX
Python final presentation kirti ppt1
Kirti Verma
 
PPT
Python Programming ppt
ismailmrribi
 
PPTX
Python PPT
Edureka!
 
PDF
Introduction To Python | Edureka
Edureka!
 
PPTX
Data Analysis in Python-NumPy
Devashish Kumar
 
PPTX
Introduction to-python
Aakashdata
 
PPTX
Basic of python for data analysis
Pramod Toraskar
 
PDF
Python Class | Python Programming | Python Tutorial | Edureka
Edureka!
 
PDF
Data Science vs Machine Learning – What’s The Difference? | Data Science Cour...
Edureka!
 
PDF
Data Engineering Basics
Catherine Kimani
 
PPTX
Feature Store as a Data Foundation for Machine Learning
Provectus
 
PPT
Python ppt
Mohita Pandey
 
PPT
Introduction to Python
Nowell Strite
 
PPTX
Beginning Python Programming
St. Petersburg College
 
PPTX
Big data and Hadoop
Rahul Agarwal
 
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Introduction to Data Engineering
Vivek Aanand Ganesan
 
Introduction to Python for Data Science
Arc & Codementor
 
Python Basics | Python Tutorial | Edureka
Edureka!
 
Exploratory Data Analysis using Python
Shirin Mojarad, Ph.D.
 
Python final presentation kirti ppt1
Kirti Verma
 
Python Programming ppt
ismailmrribi
 
Python PPT
Edureka!
 
Introduction To Python | Edureka
Edureka!
 
Data Analysis in Python-NumPy
Devashish Kumar
 
Introduction to-python
Aakashdata
 
Basic of python for data analysis
Pramod Toraskar
 
Python Class | Python Programming | Python Tutorial | Edureka
Edureka!
 
Data Science vs Machine Learning – What’s The Difference? | Data Science Cour...
Edureka!
 
Data Engineering Basics
Catherine Kimani
 
Feature Store as a Data Foundation for Machine Learning
Provectus
 
Python ppt
Mohita Pandey
 
Introduction to Python
Nowell Strite
 
Beginning Python Programming
St. Petersburg College
 
Big data and Hadoop
Rahul Agarwal
 

Similar to Introduction to Python Programing (20)

KEY
Programming with Python: Week 1
Ahmet Bulut
 
PPTX
4_Introduction to Python Programming.pptx
Gnanesh12
 
PPTX
Python programming language introduction unit
michaelaaron25322
 
PPTX
Python intro
Piyush rai
 
PPTX
ITC 110 Week 10 Introdution to Python .pptx
aaaaaannnnn6
 
PDF
Python Module-1.1.pdf
4HG19EC010HARSHITHAH
 
PDF
Python_Programming_PPT Basics of python programming language
earningmoney9595
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Introduction to python
Mohammed Rafi
 
PPTX
Introduction to Python – Learn Python Programming.pptx
HassanShah396906
 
PPTX
PYTHON FEATURES.pptx
MaheShiva
 
PDF
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
PDF
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
ZIP
An Introduction to PyPy
Michael Hudson-Doyle
 
PPT
1-ppt-python.ppt
ssusera99a83
 
PDF
Class_X_PYTHON_J.pdf
SanjeedaPraween
 
PPTX
Python programming 2nd
Aishwarya Deshmukh
 
PDF
Python Programming.pdf
ssuser9a6ca1
 
PDF
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
PPT
Python slides for the beginners to learn
krishna43511
 
Programming with Python: Week 1
Ahmet Bulut
 
4_Introduction to Python Programming.pptx
Gnanesh12
 
Python programming language introduction unit
michaelaaron25322
 
Python intro
Piyush rai
 
ITC 110 Week 10 Introdution to Python .pptx
aaaaaannnnn6
 
Python Module-1.1.pdf
4HG19EC010HARSHITHAH
 
Python_Programming_PPT Basics of python programming language
earningmoney9595
 
Python basic programing language for automation
DanialHabibi2
 
Introduction to python
Mohammed Rafi
 
Introduction to Python – Learn Python Programming.pptx
HassanShah396906
 
PYTHON FEATURES.pptx
MaheShiva
 
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
An Introduction to PyPy
Michael Hudson-Doyle
 
1-ppt-python.ppt
ssusera99a83
 
Class_X_PYTHON_J.pdf
SanjeedaPraween
 
Python programming 2nd
Aishwarya Deshmukh
 
Python Programming.pdf
ssuser9a6ca1
 
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Python slides for the beginners to learn
krishna43511
 
Ad

Recently uploaded (20)

PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Controller Request and Response in Odoo18
Celine George
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
Horarios de distribución de agua en julio
pegazohn1978
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Ad

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.