Python tutorial for beginners - Tib academy

TIB Academy
TIB AcademyTIB Academy
INTRODUCTION
TO
PYTHON
Session-1
** python
□
□
□
□
□
□
□
□
□
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 Van 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
administration utilities in C was taking too long. Moreover,
doing these things in the Bourne shell wouldn't work for a
variety of reasons. ...
So, there was a need for a language that would
bridge the gap between C and the shell”
- Guido Van Rossum
Scope of Python
Science
- Bioinformatics System
Administration -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,
□ 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 »>
iTunes
Lenovo
Maintenance
Memeo
Microsoft Office Microsoft
Silverlight MyPC Backup
Notepad+ +
00V00 PriceMeter Privacy
SafeGuard Protected Search
Python 2.7 r* IDLE (Python
GUI)
** Module Docs ^ Python
(command line) Python
Manuals j§l Uninstall Python
Resolver 2.2 Skype
SmileysWeLove for IE
Computer Control
Panel Devices and
Printei Default
Programs Help and
Support
i Back
Search programs and files
1 © f £
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 YouTube 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
x = 34 - 23 # A comment.
y = “Hello” # Another one.
z = 3.45
if z == 3.45 or y == “Hello”: x = x + 1
y = y + “ World” # String concat. 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 Bytecode Runtime
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
1 von 20

Más contenido relacionado

Was ist angesagt?(20)

Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda2.7K views
Python by RjPython by Rj
Python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli2K views
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata6K views
Python pptPython ppt
Python ppt
Mohita Pandey3.7K views
Python - the basicsPython - the basics
Python - the basics
University of Technology5.1K views
An introduction to Python for absolute beginnersAn introduction to Python for absolute beginners
An introduction to Python for absolute beginners
Kálmán "KAMI" Szalai1.7K views
PythonPython
Python
GAnkitgupta1.3K views
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar129.2K views
Introduction pythonIntroduction python
Introduction python
Jumbo Techno e_Learning323 views
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
Dipankar Achinta4.4K views
Introduction to pythonIntroduction to python
Introduction to python
Mohammed Rafi540 views
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin7.6K views
Python course syllabusPython course syllabus
Python course syllabus
Sugantha T2.8K views
Python IntroPython Intro
Python Intro
Tim Penhey3.4K views
PythonPython
Python
Learnbay Datascience586 views
Python  programmingPython  programming
Python programming
AshwinKumarR7574 views
Python (basic)Python (basic)
Python (basic)
Sabyasachi Moitra2.7K views
Introduction to pythonIntroduction to python
Introduction to python
MaheshPandit16307 views

Similar a Python tutorial for beginners - Tib academy

intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdfANIKULSAIKH
70 views20 Folien
Python quick guide1Python quick guide1
Python quick guide1Kanchilug
3.2K views70 Folien

Similar a Python tutorial for beginners - Tib academy(20)

intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdf
ANIKULSAIKH70 views
Python Programming Draft PPT.pptxPython Programming Draft PPT.pptx
Python Programming Draft PPT.pptx
LakshmiNarayanaReddy4870 views
Presentation on pythonPresentation on python
Presentation on python
Venkat Projects232 views
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug 3.2K views
Module1-Chapter1_ppt.pptxModule1-Chapter1_ppt.pptx
Module1-Chapter1_ppt.pptx
SandeepR957 views
Python basicPython basic
Python basic
radhikaadroja193 views
Introduction to the PythonIntroduction to the Python
Introduction to the Python
BMS Institute of Technology596 views
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
hemantmohite64 views
INTRODUCTION-TO-PYTHONINTRODUCTION-TO-PYTHON
INTRODUCTION-TO-PYTHON
RuchiNagar342 views
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptx
YashSharma3578571.9K views
Introduction to PythonIntroduction to Python
Introduction to Python
DrMohammed Qassim259 views
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli2K views
Introduction to pythonIntroduction to python
Introduction to python
priyanshupanchal827 views
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE
teachersduniya.com 251 views
Cmpe202 01 ResearchCmpe202 01 Research
Cmpe202 01 Research
vladimirkorshak450 views

Más de TIB Academy

MsbiMsbi
MsbiTIB Academy
64 views8 Folien
Ios operating systemIos operating system
Ios operating systemTIB Academy
316 views24 Folien
Salesforce  Salesforce
Salesforce TIB Academy
130 views34 Folien
CCNA IntroducingCCNA Introducing
CCNA IntroducingTIB Academy
49 views22 Folien
CCNA IntroducingCCNA Introducing
CCNA IntroducingTIB Academy
34 views18 Folien

Más de TIB Academy(17)

MsbiMsbi
Msbi
TIB Academy64 views
Ios operating systemIos operating system
Ios operating system
TIB Academy316 views
Salesforce  Salesforce
Salesforce
TIB Academy130 views
CCNA IntroducingCCNA Introducing
CCNA Introducing
TIB Academy49 views
Hadoop training in bangaloreHadoop training in bangalore
Hadoop training in bangalore
TIB Academy17 views
CCNA IntroducingCCNA Introducing
CCNA Introducing
TIB Academy34 views
Hadoop tutorial for Freshers, Hadoop tutorial for Freshers,
Hadoop tutorial for Freshers,
TIB Academy23 views
Hadoop trainingHadoop training
Hadoop training
TIB Academy33 views
Selenium institute in bangaloreSelenium institute in bangalore
Selenium institute in bangalore
TIB Academy52 views
Django framework Django framework
Django framework
TIB Academy59 views
Python basicsPython basics
Python basics
TIB Academy102 views
Core java  tutorialsCore java  tutorials
Core java tutorials
TIB Academy83 views
Spring tutorialsSpring tutorials
Spring tutorials
TIB Academy23 views
7878
78
TIB Academy8 views

Último(20)

Python tutorial for beginners - Tib academy

  • 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 Van 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 administration utilities in C was taking too long. Moreover, doing these things in the Bourne shell wouldn't work for a variety of reasons. ... So, there was a need for a language that would bridge the gap between C and the shell” - Guido Van Rossum
  • 8. Scope of Python Science - Bioinformatics System Administration -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,
  • 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. iTunes Lenovo Maintenance Memeo Microsoft Office Microsoft Silverlight MyPC Backup Notepad+ + 00V00 PriceMeter Privacy SafeGuard Protected Search Python 2.7 r* IDLE (Python GUI) ** Module Docs ^ Python (command line) Python Manuals j§l Uninstall Python Resolver 2.2 Skype SmileysWeLove for IE Computer Control Panel Devices and Printei Default Programs Help and Support i Back Search programs and files 1 © f £
  • 15. 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 YouTube video sharing service is largely written in Python
  • 16. What can I do with Python...? System programming Graphical User Interface Programming Internet Scripting Component Integration Database Programming Gaming, Images, XML , Robot and more
  • 17. A Sample Code x = 34 - 23 # A comment. y = “Hello” # Another one. z = 3.45 if z == 3.45 or y == “Hello”: x = x + 1 y = y + “ World” # String concat. print x print y
  • 18. 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
  • 19. 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 Bytecode Runtime Source code extension is .py Byte code extension is .pyc (compiled python code)
  • 20. 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