SlideShare a Scribd company logo
1 of 9
Download to read offline
Introduction
Python
Python
● Combines the features of C and JAVA
● It offers elegant style of developing programs like C
● It offers classes and objects like Java
Features of Python
● Simple
● More clarity
● Less stress on reading and understanding the syntax
● Easy to learn
● Uses very few keywords
● Very simple structure, resembles C
● Open source
● High level language
● Dynamically typed
● Type of the variable is not declared statically
Features of Python...
● Platform Independent
○ Python compiler generates byte code
○ PVM interprets the byte code
● Portable
● Procedure and Object oriented language
● Interpreted
● Extensible
● Embeddable
● Huge Library
● Scripting Language
● Database Connectivity
○ Provides interfaces to DB like Oracle, Sybase or MySql
Execution of a Python Program
● Example:
● x.py → python_compiler → x.pyc → PVM → Machine_Code
● python -m py_compile x.py
● python x.cpython-34.py
● python -m dis add.py
Memory Management in Python
● In C or C++, allocation and deallocation of memory will be done manually
● malloc(), calloc(), realloc() or free()
● In python, it is done at run time automatically
● Memory Manager inside the PVM takes care of allocating memory for all objects in
Python.
● All objects are stored in Heap
Garbage Collection in Python
● Garbage collector is a module in Python that is useful to delete objects from memory
which are not used in the program.
● The module that represents the GC is gc.
● It will keep track of how many times the object is referenced.
● If it is referenced 0 times, then gc will remove object from memory.
C Vs Python
C Python
Procedure Oriented language Object Oriented language
Faster Slower
Compulsory to declare the data types of variables Data Types are not required
Type discipline is static and weak Dynamic and strong
Pointers concept present No pointers concept
No exception handling facility Exception handling facility is robust
Do-while is present Absent
Has switch statement No Switch
C Vs Python
C Python
Manually allocate the memory Automatic
Absence of GC GC is present
Supports Single and multi dimensional arrays Supports only single dimension
Array should be positive Can be Positive or negative
Array bounds checking is not present Present
Indentation is not necessary Strictly needed
Every statement is terminated by ; No semicolon

More Related Content

What's hot

a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
Kai Aras
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
Doug Schuster
 
Tech Days 2015: Multi-language Programming with GPRbuild
Tech Days 2015: Multi-language Programming with GPRbuildTech Days 2015: Multi-language Programming with GPRbuild
Tech Days 2015: Multi-language Programming with GPRbuild
AdaCore
 

What's hot (20)

IHTM Python PCEP Introduction to Python
IHTM Python PCEP Introduction to PythonIHTM Python PCEP Introduction to Python
IHTM Python PCEP Introduction to Python
 
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
 
Introduction to protocol buffer
Introduction to protocol bufferIntroduction to protocol buffer
Introduction to protocol buffer
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Lua vs python
Lua vs pythonLua vs python
Lua vs python
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
 
PyPy
PyPyPyPy
PyPy
 
Introduction python
Introduction pythonIntroduction python
Introduction python
 
a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
 
Four Python Pains
Four Python PainsFour Python Pains
Four Python Pains
 
平行化你的工作 part1
平行化你的工作 part1平行化你的工作 part1
平行化你的工作 part1
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
 
Python in real world.
Python in real world.Python in real world.
Python in real world.
 
LLVM
LLVMLLVM
LLVM
 
Clang: More than just a C/C++ Compiler
Clang: More than just a C/C++ CompilerClang: More than just a C/C++ Compiler
Clang: More than just a C/C++ Compiler
 
Golang
GolangGolang
Golang
 
Tech Days 2015: Multi-language Programming with GPRbuild
Tech Days 2015: Multi-language Programming with GPRbuildTech Days 2015: Multi-language Programming with GPRbuild
Tech Days 2015: Multi-language Programming with GPRbuild
 
Tech Days 2015: SPARK 2014
Tech Days 2015: SPARK 2014Tech Days 2015: SPARK 2014
Tech Days 2015: SPARK 2014
 
Whirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic Linker
 

Similar to Introduction to Python

Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Devloper
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 

Similar to Introduction to Python (20)

Rusty Python
Rusty PythonRusty Python
Rusty Python
 
Python: Thanks for the memories
Python: Thanks for the memoriesPython: Thanks for the memories
Python: Thanks for the memories
 
Introduction to Python Programing
Introduction to Python ProgramingIntroduction to Python Programing
Introduction to Python Programing
 
Python 101 - Indonesia AI Society.pdf
Python 101 - Indonesia AI Society.pdfPython 101 - Indonesia AI Society.pdf
Python 101 - Indonesia AI Society.pdf
 
Comparison between python and c++
Comparison between python and c++Comparison between python and c++
Comparison between python and c++
 
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development EnvironmentPython Mastery: A Comprehensive Guide to Setting Up Your Development Environment
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
 
Getting Started with PHP Extensions
Getting Started with PHP ExtensionsGetting Started with PHP Extensions
Getting Started with PHP Extensions
 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
 
AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8
 
Python assignment help from professional programmers
Python assignment help from professional programmersPython assignment help from professional programmers
Python assignment help from professional programmers
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Development_C_Extension_with_Pybind11.pdf
Development_C_Extension_with_Pybind11.pdfDevelopment_C_Extension_with_Pybind11.pdf
Development_C_Extension_with_Pybind11.pdf
 
Why learn python in 2017?
Why learn python in 2017?Why learn python in 2017?
Why learn python in 2017?
 
Go at uber
Go at uberGo at uber
Go at uber
 
Building SciPy kernels with Pythran
Building SciPy kernels with PythranBuilding SciPy kernels with Pythran
Building SciPy kernels with Pythran
 
IPT 2.pptx
IPT 2.pptxIPT 2.pptx
IPT 2.pptx
 

More from Emertxe Information Technologies Pvt Ltd

More from Emertxe Information Technologies Pvt Ltd (20)

premium post (1).pdf
premium post (1).pdfpremium post (1).pdf
premium post (1).pdf
 
Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
10_isxdigit.pdf
 
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
01_student_record.pdf
 
02_swap.pdf
02_swap.pdf02_swap.pdf
02_swap.pdf
 
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
01_sizeof.pdf
 
07_product_matrix.pdf
07_product_matrix.pdf07_product_matrix.pdf
07_product_matrix.pdf
 
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
06_sort_names.pdf
 
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
05_fragments.pdf
 
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Introduction to Python

  • 2. Python ● Combines the features of C and JAVA ● It offers elegant style of developing programs like C ● It offers classes and objects like Java
  • 3. Features of Python ● Simple ● More clarity ● Less stress on reading and understanding the syntax ● Easy to learn ● Uses very few keywords ● Very simple structure, resembles C ● Open source ● High level language ● Dynamically typed ● Type of the variable is not declared statically
  • 4. Features of Python... ● Platform Independent ○ Python compiler generates byte code ○ PVM interprets the byte code ● Portable ● Procedure and Object oriented language ● Interpreted ● Extensible ● Embeddable ● Huge Library ● Scripting Language ● Database Connectivity ○ Provides interfaces to DB like Oracle, Sybase or MySql
  • 5. Execution of a Python Program ● Example: ● x.py → python_compiler → x.pyc → PVM → Machine_Code ● python -m py_compile x.py ● python x.cpython-34.py ● python -m dis add.py
  • 6. Memory Management in Python ● In C or C++, allocation and deallocation of memory will be done manually ● malloc(), calloc(), realloc() or free() ● In python, it is done at run time automatically ● Memory Manager inside the PVM takes care of allocating memory for all objects in Python. ● All objects are stored in Heap
  • 7. Garbage Collection in Python ● Garbage collector is a module in Python that is useful to delete objects from memory which are not used in the program. ● The module that represents the GC is gc. ● It will keep track of how many times the object is referenced. ● If it is referenced 0 times, then gc will remove object from memory.
  • 8. C Vs Python C Python Procedure Oriented language Object Oriented language Faster Slower Compulsory to declare the data types of variables Data Types are not required Type discipline is static and weak Dynamic and strong Pointers concept present No pointers concept No exception handling facility Exception handling facility is robust Do-while is present Absent Has switch statement No Switch
  • 9. C Vs Python C Python Manually allocate the memory Automatic Absence of GC GC is present Supports Single and multi dimensional arrays Supports only single dimension Array should be positive Can be Positive or negative Array bounds checking is not present Present Indentation is not necessary Strictly needed Every statement is terminated by ; No semicolon