SlideShare a Scribd company logo
2
Most read
11
Most read
14
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

PPTX
Introduction to python
PDF
Python Programming Tutorial | Edureka
PPTX
Object oriented programming in python
PPTX
Data Structures in Python
PDF
Python pandas tutorial
PDF
Introduction to python
PDF
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Introduction to python
Python Programming Tutorial | Edureka
Object oriented programming in python
Data Structures in Python
Python pandas tutorial
Introduction to python
Python Course | Python Programming | Python Tutorial | Python Training | Edureka

What's hot (20)

PDF
Introduction to Python Unit -1 Part .pdf
PPTX
Python OOPs
PPTX
Intro to Python Programming Language
PDF
Introduction to python programming
PPTX
Python PPT
PPTX
Introduction to the basics of Python programming (part 1)
PDF
What is Python? | Edureka
PPTX
Introduction to python
PDF
Introduction to python
PPTX
Python oop third class
PDF
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
PPTX
Python Tutorial Part 1
PPTX
PPT on Data Science Using Python
PDF
Python Basics | Python Tutorial | Edureka
PPT
Introduction to Python
PDF
Python course syllabus
PPTX
Basics of Object Oriented Programming in Python
PPTX
Basics of python
PDF
Python Class | Python Programming | Python Tutorial | Edureka
PDF
Introduction to Python
Introduction to Python Unit -1 Part .pdf
Python OOPs
Intro to Python Programming Language
Introduction to python programming
Python PPT
Introduction to the basics of Python programming (part 1)
What is Python? | Edureka
Introduction to python
Introduction to python
Python oop third class
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Tutorial Part 1
PPT on Data Science Using Python
Python Basics | Python Tutorial | Edureka
Introduction to Python
Python course syllabus
Basics of Object Oriented Programming in Python
Basics of python
Python Class | Python Programming | Python Tutorial | Edureka
Introduction to Python
Ad

Similar to Introduction to Python Programing (20)

PPTX
Introduction to python
PPTX
Python PPT by Sushil Sir.pptx
PPT
1-ppt-python.ppt
PDF
Python Programing Bio computing,basic concepts lab,,
PDF
introduction of python in data science
PDF
DOCX
Python introduction
PDF
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
PPT
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
PPT
Py-Slides-1.ppt1234444444444444444444444444444444444444444
PPT
Python Over View (Python for mobile app Devt)1.ppt
PPT
program on python what is python where it was started by whom started
PPT
Python slides for the beginners to learn
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
PDF
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
PPT
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
PDF
Introduction to Python
PDF
Free Python Notes PDF - Python Crash Course
DOCX
Python notes compilation (4).docx
PPTX
Python introduction towards data science
Introduction to python
Python PPT by Sushil Sir.pptx
1-ppt-python.ppt
Python Programing Bio computing,basic concepts lab,,
introduction of python in data science
Python introduction
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Py-Slides-1.ppt1234444444444444444444444444444444444444444
Python Over View (Python for mobile app Devt)1.ppt
program on python what is python where it was started by whom started
Python slides for the beginners to learn
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Introduction to Python
Free Python Notes PDF - Python Crash Course
Python notes compilation (4).docx
Python introduction towards data science
Ad

Recently uploaded (20)

PDF
Business Ethics Teaching Materials for college
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Open folder Downloads.pdf yes yes ges yes
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PPTX
Cell Structure & Organelles in detailed.
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Pre independence Education in Inndia.pdf
PPTX
Onica Farming 24rsclub profitable farm business
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Business Ethics Teaching Materials for college
Abdominal Access Techniques with Prof. Dr. R K Mishra
Open folder Downloads.pdf yes yes ges yes
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Revamp in MTO Odoo 18 Inventory - Odoo Slides
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Week 4 Term 3 Study Techniques revisited.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Renaissance Architecture: A Journey from Faith to Humanism
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
Cell Structure & Organelles in detailed.
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pre independence Education in Inndia.pdf
Onica Farming 24rsclub profitable farm business
3rd Neelam Sanjeevareddy Memorial Lecture.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.