SlideShare a Scribd company logo
11
Most read
12
Most read
13
Most read
Python Tutorial | Python Programming Language
Agenda
What is Python…?
Differences between program and scripting language
History of Python
Scope of Python
Why do people use Python?
Installing Python IDE
Who uses python today
What can I do with python
A Sample Code
Python code execution
Running Python
What is Python…?
Python is a general purpose programming language that is
often applied in scripting roles.
So, Python is programming language as well as scripting
language.
Python is also called as Interpreted language
Differences between program and
scripting language
Program
a program is executed (i.e.
the source is first compiled,
and the result of that
compilation is expected)
A "program" in general, is a
sequence of instructions
written so that a computer
can perform certain task.
Scripting
a script is interpreted
A "script" is code written in
a scripting language. A
scripting language is nothing
but a type of programming
language in which we can
write code to control
another software application.
History
Invented in the Netherlands, early 90s by Guido van Rossum
Python was conceived in the late 1980s and its
implementation was started in December 1989
Guido V
an Rossum is fan of ‘Monty Python’s Flying
Circus’, this is a famous TV show in Netherlands
Named after Monty Python
Open sourced from the beginning
Python’s Benevolent Dictator For Life
“Python is an experiment in how much
freedom program-mers need. Too
much freedom and nobody can read
another's code; too little and
expressive-ness is endangered.”
- Guido van Rossum
Why was python created?
"My original motivation for creating Python was the
perceived need for a higher level language in the
Amoeba [Operating Systems] project.
I realized that the development of system
Moreover, doing these things in the Bourne
administration utilities in C was taking too long.
shell
wouldn'twork foravarietyof reasons. ...
So, there was a need for a language that
would bridge thegap between C and the shell”
- GuidoVan Rossum
Scope of Python
Science
- Bioinformatics
SystemAdministration
-Unix
-Web logic
-Web sphere
Web Application Development
-CGI
-Jython – Servlets
Testing scripts
Why do people use Python…?
The following primary factors cited by Python users
seem to be these:
Python is object-oriented
Structure supports such concepts as polymorphism, operation
overloading, and multiple inheritance.
Indentation
Indentation is one of the greatest future in Python.
It's free (open source)
Downloading and installing Python is free and easy
Source code is easily accessible
It's powerful
- Dynamic typing
- Built-in types and tools
- Library utilities
- Third party utilities (e.g. Numeric, NumPy, SciPy)
-Automatic memory management
It's portable
- Python runs virtually every major platform used today
-As long as you have a compatible Python interpreter installed,
Python programs will run in exactly the same manner,
irrespective of platform.
It's mixable
- Python can be linked to components written in other languages easily
- Linking to fast, compiled code is useful to computationally intensive
problems
- - Python/C integration is quite common
It's easy to use
- No intermediate compile and link steps as in C/ C++
- Python programs are compiled automatically to an intermediate
form called bytecode, which the interpreter then reads
- This gives Python the development speed of an interpreter without
the performance loss inherent in purely interpreted languages
It's easy to learn
- Structure and syntax are pretty intuitive and easy to grasp
Installing Python
Python is pre-installed on most Unix systems, including
Linux and MAC OS X
But for in Windows Operating Systems , user can
download from the https://www.python.org/downloads/
- from the above link download latest version of python
IDE and install, recent version is 3.4.1 but most of
them uses version 2.7.7 only
After installing the
Python Ver#2.7.7, go to
start menu then click on
python 2.7 in that one
you can select python
(command line) it is
prompt with >>>
Who uses python today…
Python is being applied in real revenue-generating products
by real companies. For instance:
Google makes extensive use of Python in its web search
system, and employs Python’s creator.
Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM
use Python for hardware testing.
ESRI uses Python as an end-user customization tool for its
popular GIS mapping products.
The Y
ouTube video sharing service is largely written in
Python
What can I do with Python…?
System programming
Graphical User Interface Programming
Internet Scripting
Component Integration
Database Programming
Gaming, Images, XML , Robot and more
A Sample Code
# A comment.
#Another one.
x = 34 - 23
y = “Hello”
z = 3.45
if z == 3.45 or y == “Hello”:
x = x + 1
# String concat.
y = y + “ World”
print x
print y
Enough to understand the code
Indentation matters to code meaning
-Block structure indicated by indentation
First assignment to a variable creates it
- Variable types don’t need to be declared.
-Python figures out the variable types on its own.
Assignment is = and comparison is ==
For numbers + - * / % are as expected
- Special use of + for string concatenation and % for string
formatting (as in C’s printf)
Logical operators are words (and, or, not) not symbols
The basic printing command is print
Python Code Execution
Python’s traditional runtime execution model: source code you
type is translated to byte code, which is then run by the Python
Virtual Machine. Your code is automatically compiled, but then
it is interpreted.
Source code extension is .py
Byte code extension is .pyc (compiled python code)
Running Python
Once you're inside the Python interpreter, type in commands at will.
• Examples:
>>> print 'Hello world'
Hello world
# Relevant output is displayed on subsequent lines without the >>>
symbol
>>> x = [0,1,2]
# Quantities stored in memory are not displayed by default
>>> x
# If a quantity is stored in memory, typing its name will display it
[0,1,2]
>>> 2+3
5

More Related Content

What's hot (8)

PDF
6 el proceso de poisson
Yennyfer Paredes
 
DOCX
Estadística Probabilidades
Edwin Lema
 
PDF
Distribucioones discretas
angiegutierrez11
 
DOCX
Cadenas de markov
Ivonne Poletto
 
PPT
DistribucióN De Poisson
Jesus Sanchez
 
PPT
Distribucion normal
aliriopardov
 
PDF
Distribucion Normal
Artemio Villegas
 
6 el proceso de poisson
Yennyfer Paredes
 
Estadística Probabilidades
Edwin Lema
 
Distribucioones discretas
angiegutierrez11
 
Cadenas de markov
Ivonne Poletto
 
DistribucióN De Poisson
Jesus Sanchez
 
Distribucion normal
aliriopardov
 
Distribucion Normal
Artemio Villegas
 

Similar to Python Tutorial | Python Programming Language (20)

PPTX
Introduction python
Jumbo Techno e_Learning
 
PPTX
Introduction to python for Beginners
Sujith Kumar
 
PDF
intro.pptx (1).pdf
ANIKULSAIKH
 
PPTX
Python tutorial for beginners - Tib academy
TIB Academy
 
PPTX
Python Programming Draft PPT.pptx
LakshmiNarayanaReddy48
 
PPTX
Phython Programming Language
R.h. Himel
 
PPTX
python programminig and introduction.pptx
urvashipundir04
 
PPTX
introduction to python in computer graphics.pptx
urvashipundir04
 
PPTX
Python is a high-level, interpreted programming language that emphasizes read...
bikomaster9459
 
PPTX
Python is a high-level, interpreted programming language known for its simpli...
bikomaster9459
 
PPTX
Python is a high-level, interpreted programming language known for its simpli...
bikomaster9459
 
PPT
Python programming-2-2048 (30 files merged).ppt
pprince22982
 
PPT
Python programming notes all in one python ppt
pprince22982
 
PPTX
Introduction to python
priyanshupanchal8
 
PDF
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
Sana Khan
 
PPTX
Python presentation by Monu Sharma
Mayank Sharma
 
PPT
1-ppt-python.ppt
ssusera99a83
 
PPTX
An Introduction To Python - Python, Print()
Blue Elephant Consulting
 
DOCX
Seminar report on python 3 course
HimanshuPanwar38
 
DOCX
Seminar report On Python
Shivam Gupta
 
Introduction python
Jumbo Techno e_Learning
 
Introduction to python for Beginners
Sujith Kumar
 
intro.pptx (1).pdf
ANIKULSAIKH
 
Python tutorial for beginners - Tib academy
TIB Academy
 
Python Programming Draft PPT.pptx
LakshmiNarayanaReddy48
 
Phython Programming Language
R.h. Himel
 
python programminig and introduction.pptx
urvashipundir04
 
introduction to python in computer graphics.pptx
urvashipundir04
 
Python is a high-level, interpreted programming language that emphasizes read...
bikomaster9459
 
Python is a high-level, interpreted programming language known for its simpli...
bikomaster9459
 
Python is a high-level, interpreted programming language known for its simpli...
bikomaster9459
 
Python programming-2-2048 (30 files merged).ppt
pprince22982
 
Python programming notes all in one python ppt
pprince22982
 
Introduction to python
priyanshupanchal8
 
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
Sana Khan
 
Python presentation by Monu Sharma
Mayank Sharma
 
1-ppt-python.ppt
ssusera99a83
 
An Introduction To Python - Python, Print()
Blue Elephant Consulting
 
Seminar report on python 3 course
HimanshuPanwar38
 
Seminar report On Python
Shivam Gupta
 
Ad

More from anaveenkumar4 (14)

PPT
simulation based project presentation matlab Problem background Traditional s...
anaveenkumar4
 
PPT
04_python_functions.ppt You can define functions to provide the required func...
anaveenkumar4
 
PDF
Electric circuits are classified in several ways. A direct-current circuit ca...
anaveenkumar4
 
PPTX
MATLAB UNIT-III.pptx
anaveenkumar4
 
PPTX
project.pptx
anaveenkumar4
 
PPT
pump.ppt
anaveenkumar4
 
PPTX
RET UNIT-4.pptx
anaveenkumar4
 
PDF
13012-41797-1-RV.pdf
anaveenkumar4
 
PDF
SolarThermal.pdf
anaveenkumar4
 
PDF
1-s2.0-S1878029613000716-main.pdf
anaveenkumar4
 
PPTX
2_Off_Grid_Grid_Tied.pptx
anaveenkumar4
 
PPTX
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptx
anaveenkumar4
 
PPTX
Batch 6.pptx
anaveenkumar4
 
PDF
9-_Object_Oriented_Programming_Using_Python.pdf
anaveenkumar4
 
simulation based project presentation matlab Problem background Traditional s...
anaveenkumar4
 
04_python_functions.ppt You can define functions to provide the required func...
anaveenkumar4
 
Electric circuits are classified in several ways. A direct-current circuit ca...
anaveenkumar4
 
MATLAB UNIT-III.pptx
anaveenkumar4
 
project.pptx
anaveenkumar4
 
pump.ppt
anaveenkumar4
 
RET UNIT-4.pptx
anaveenkumar4
 
13012-41797-1-RV.pdf
anaveenkumar4
 
SolarThermal.pdf
anaveenkumar4
 
1-s2.0-S1878029613000716-main.pdf
anaveenkumar4
 
2_Off_Grid_Grid_Tied.pptx
anaveenkumar4
 
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptx
anaveenkumar4
 
Batch 6.pptx
anaveenkumar4
 
9-_Object_Oriented_Programming_Using_Python.pdf
anaveenkumar4
 
Ad

Recently uploaded (20)

PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PDF
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PDF
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
PDF
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
PPTX
Engineering Quiz ShowEngineering Quiz Show
CalvinLabial
 
PDF
13th International Conference on Artificial Intelligence, Soft Computing (AIS...
ijait
 
PPTX
darshai cross section and river section analysis
muk7971
 
PPTX
Diabetes diabetes diabetes diabetes jsnsmxndm
130SaniyaAbduNasir
 
PPTX
CM Function of the heart pp.pptxafsasdfddsf
drmaneharshalid
 
PDF
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
PDF
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
PDF
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
PPTX
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PDF
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
PPTX
Electrical_Safety_EMI_EMC_Presentation.pptx
drmaneharshalid
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PPTX
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
PDF
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
Engineering Quiz ShowEngineering Quiz Show
CalvinLabial
 
13th International Conference on Artificial Intelligence, Soft Computing (AIS...
ijait
 
darshai cross section and river section analysis
muk7971
 
Diabetes diabetes diabetes diabetes jsnsmxndm
130SaniyaAbduNasir
 
CM Function of the heart pp.pptxafsasdfddsf
drmaneharshalid
 
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
Electrical_Safety_EMI_EMC_Presentation.pptx
drmaneharshalid
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
 

Python Tutorial | Python Programming Language

  • 2. Agenda What is Python…? Differences between program and scripting language History of Python Scope of Python Why do people use Python? Installing Python IDE Who uses python today What can I do with python A Sample Code Python code execution Running Python
  • 3. What is Python…? Python is a general purpose programming language that is often applied in scripting roles. So, Python is programming language as well as scripting language. Python is also called as Interpreted language
  • 4. Differences between program and scripting language Program a program is executed (i.e. the source is first compiled, and the result of that compilation is expected) A "program" in general, is a sequence of instructions written so that a computer can perform certain task. Scripting a script is interpreted A "script" is code written in a scripting language. A scripting language is nothing but a type of programming language in which we can write code to control another software application.
  • 5. History Invented in the Netherlands, early 90s by Guido van Rossum Python was conceived in the late 1980s and its implementation was started in December 1989 Guido V an Rossum is fan of ‘Monty Python’s Flying Circus’, this is a famous TV show in Netherlands Named after Monty Python Open sourced from the beginning
  • 6. Python’s Benevolent Dictator For Life “Python is an experiment in how much freedom program-mers need. Too much freedom and nobody can read another's code; too little and expressive-ness is endangered.” - Guido van Rossum
  • 7. Why was python created? "My original motivation for creating Python was the perceived need for a higher level language in the Amoeba [Operating Systems] project. I realized that the development of system Moreover, doing these things in the Bourne administration utilities in C was taking too long. shell wouldn'twork foravarietyof reasons. ... So, there was a need for a language that would bridge thegap between C and the shell” - GuidoVan Rossum
  • 8. Scope of Python Science - Bioinformatics SystemAdministration -Unix -Web logic -Web sphere Web Application Development -CGI -Jython – Servlets Testing scripts
  • 9. Why do people use Python…? The following primary factors cited by Python users seem to be these: Python is object-oriented Structure supports such concepts as polymorphism, operation overloading, and multiple inheritance. Indentation Indentation is one of the greatest future in Python. It's free (open source) Downloading and installing Python is free and easy Source code is easily accessible
  • 10. It's powerful - Dynamic typing - Built-in types and tools - Library utilities - Third party utilities (e.g. Numeric, NumPy, SciPy) -Automatic memory management It's portable - Python runs virtually every major platform used today -As long as you have a compatible Python interpreter installed, Python programs will run in exactly the same manner, irrespective of platform.
  • 11. It's mixable - Python can be linked to components written in other languages easily - Linking to fast, compiled code is useful to computationally intensive problems - - Python/C integration is quite common It's easy to use - No intermediate compile and link steps as in C/ C++ - Python programs are compiled automatically to an intermediate form called bytecode, which the interpreter then reads - This gives Python the development speed of an interpreter without the performance loss inherent in purely interpreted languages It's easy to learn - Structure and syntax are pretty intuitive and easy to grasp
  • 12. Installing Python Python is pre-installed on most Unix systems, including Linux and MAC OS X But for in Windows Operating Systems , user can download from the https://www.python.org/downloads/ - from the above link download latest version of python IDE and install, recent version is 3.4.1 but most of them uses version 2.7.7 only
  • 13. After installing the Python Ver#2.7.7, go to start menu then click on python 2.7 in that one you can select python (command line) it is prompt with >>>
  • 14. Who uses python today… Python is being applied in real revenue-generating products by real companies. For instance: Google makes extensive use of Python in its web search system, and employs Python’s creator. Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM use Python for hardware testing. ESRI uses Python as an end-user customization tool for its popular GIS mapping products. The Y ouTube video sharing service is largely written in Python
  • 15. What can I do with Python…? System programming Graphical User Interface Programming Internet Scripting Component Integration Database Programming Gaming, Images, XML , Robot and more
  • 16. A Sample Code # A comment. #Another one. x = 34 - 23 y = “Hello” z = 3.45 if z == 3.45 or y == “Hello”: x = x + 1 # String concat. y = y + “ World” print x print y
  • 17. Enough to understand the code Indentation matters to code meaning -Block structure indicated by indentation First assignment to a variable creates it - Variable types don’t need to be declared. -Python figures out the variable types on its own. Assignment is = and comparison is == For numbers + - * / % are as expected - Special use of + for string concatenation and % for string formatting (as in C’s printf) Logical operators are words (and, or, not) not symbols The basic printing command is print
  • 18. Python Code Execution Python’s traditional runtime execution model: source code you type is translated to byte code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then it is interpreted. Source code extension is .py Byte code extension is .pyc (compiled python code)
  • 19. Running Python Once you're inside the Python interpreter, type in commands at will. • Examples: >>> print 'Hello world' Hello world # Relevant output is displayed on subsequent lines without the >>> symbol >>> x = [0,1,2] # Quantities stored in memory are not displayed by default >>> x # If a quantity is stored in memory, typing its name will display it [0,1,2] >>> 2+3 5