SlideShare a Scribd company logo
1 of 42
PYTHON
Presented by:
R. Punithavel
What We Give you?
2
• What is Python…?
• Differences between program and scripting language
• History of Python
• Scope of Python
• What can I do with python
• Who uses python today
• Why do people use Python?
• Installing Python IDE
• ASample Code
• Python code execution
• Running Python
• Python Basic(Variable, Strings, Data types etc.)
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
3
Differences between program and
scripting language
4
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
5
• 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 programmers need.
Too much freedom and nobody can
read another's code; too little and
expressiveness is endangered.”
- Guido van Rossum
6
Why was python created?
7
"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
administration utilities in C was taking too
in the Bourne
long.
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
8
• Science
- Bioinformatics
• SystemAdministration
-Unix
-Web logic
-Web sphere
• Web Application Development
-CGI
-Jython – Servlets
• Testing scripts
What can I do with Python…?
9
• System programming
• Graphical User Interface Programming
• Internet Scripting
• Component Integration
• Database Programming
• Gaming, Images, XML , Robot and more
Who uses python today…
10
• 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
Why do people use Python…?
11
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.
.
• 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.
12
Installing Python
13
• 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 >>>
14
15
Running Python
16
Once you're inside the Python interpreter, type in commands at will.
• Examples:
>>> print 'Hello world'
Hello world
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)
17
MATH(OPERATOR) IN PYTHON
Math
Try typing this into Code:
>>> print 3 + 12
15
>>> print 12 – 3
9
>>> print 9 + 5 – 15 + 12
11
Operators:
add: +
subtract: -
Note: don’t type the arrows >>> !
19
Math
Rule: If you want Python to answer in floats, you have to
talk to it in floats.
More operators:
divide: /
multiply: *
>>> print 3 * 12
>>> print 12 / 3
>>> print 11 / 3
>>> print 12.0 / 3.0
>>> print 11.0 / 3.0
36
4
3
4.0
3.66
20
Math
21
Practice:
>>> print 2 < 3 True
>>> print 2 <= 2 False
>>> print 3 > 2 True
>>> print 2 != 3 True
>>> print False < True True
STRINGS IN PYTHON
22
Strings
23
Examples:
Try typing one without quotes:
What’s the result?
>>> “It’s a beautiful
day!”
>>> “Goodbye, cruel
world.”
>>> Aggies
>>> “Aggies”
>>> “Rice fight, never
die!”
>>> “3 + 2”
Strings
24
String operators:
concatenation: +
multiplication: *
Try concatenating:
Try multiplying:
>>>
“ “
print “Hello”
+ “world!”
+
>>>
250
print “HAHA” *
VARIABLES IN PYTHON
25
Variable
26
Create a Variable:
>>>headmaster=“Dumbledore”
>>>print headmaster
‘Dumbledore’
Assigning a New Value:
>>>headmaster=“Hardcastle”
>>>print headmaster
‘Hardcastle’
DATA TYPES IN PYTHON
Data Type:
28
Python has many native data types. Here are the important ones:
Booleans are either True or False.
Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions
(1/2 and 2/3), or even complex numbers.
Strings are sequences of Unicode characters, e.g. an HTML
document.
Bytes and byte arrays, e.g. a JPEG image file.
Lists are ordered sequences of values.
Tuples are ordered, immutable sequences of values.
Sets are unordered bags of values.
Example:
29
String
Integer
Float
List
“Whoop!”
42
3.14159
[“John”, “Paul”, “George”, “Ringo”]
Python can tell us about types using the type()
function:
>>> print type(“Whoop!”)
<type ‘str’>
LIST: DATA TYPE
30
List:
31
The list is a most versatile Data type available in Python
which can be written as a list of comma-separated values
(items) between square brackets. Important thing about a
list is that items in a list need not be of the same type.
Example:
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5 ];
SN Function with Description
1 cmp(list1, list2) Compares elements of both lists.
2 len(list) Gives the total length of the list.
3 max(list) Returns item from the list with max value.
4 min(list) Returns item from the list with min value.
5 list(seq) Converts a tuple into list.
32
List: a sequence of objects
33
>>> Beatles = [“John”, “Paul”, “George”,
“Ringo”]
>>> grades = [82, 93, 67, 99, 100]
Guess what this will output:
>>> type(Beatles)
>>> type(grades)
Lists
Index: Where an item is in the list
34
>>> Beatles = [“John”, “Paul”, “George”,
“Ringo”]
>>> Beatles[0]
‘John‘
[“John”, “Paul”, “George”, “Ringo”]
0 1 2 3
Python always starts at zero!
TUPLE: DATA TYPE
Tuples:
36
A tuple is a sequence of immutable Python objects. Tuples are
sequences, just like lists. The differences between tuples and
lists are, the tuples cannot be changed unlike lists and tuples
use parentheses, whereas lists use square brackets.
Example:
tup2 = (1, 2, 3, 4, 5 );
tup3 = ("a", "b", "c", "d“);
Accessing Values:
print "tup2[1:5]: “
Output:
tup2[1:5]: [2, 3, 4, 5]
Built-in Tuple Functions
37
Python includes the following tuple functions −
SN Function with Description
1 cmp(tuple1, tuple2) Compares elements of both tuples.
2 len(tuple) Gives the total length of the tuple.
3 max(tuple) Returns item from the tuple with max value.
4 min(tuple) Returns item from the tuple with min value.
5 tuple(seq) Converts a list into tuple.
LOOPS & CONDITIONAL
STATEMENTS
38
39
Loop Type Description
while loop Repeats a statement or group of statements
while a given condition is TRUE. It tests the
condition before executing the loop body.
for loop Executes a sequence of statements multiple
times and abbreviates the code that
manages the loop variable.
nested loops You can use one or more loop inside any
another while, for or do..while loop.
Statement Description
if statements An if statement consists of a boolean expression
followed by one or more statements.
if...else statements An if statement can be followed by an
optional else statement, which executes when
the boolean expression is FALSE.
nested if statements You can use one if or else if statement inside
another if or else if statement(s).
40
I believe the trial has shown conclusively that it is both possible and
desirable to use Python as the principal teaching language:
o It is Free (as in both cost and source code).
o It is trivial to install on a Windows PC allowing students to take
their interest further. For many the hurdle of installing a Pascal or
C compiler on a Windows machine is either too expensive or too
complicated;
o It is a flexible tool that allows both the teaching of traditional
procedural programming and modern OOP; It can be used to
teach a large number of transferable skills;
o It is a real-world programming language that can be and is used in
academia and the commercial world;
o It appears to be quicker to learn and, in combination with its many
libraries, this offers the possibility of more rapid student
development allowing the course to be made more challenging
and varied;
o and most importantly, its clean syntax offers increased
understanding and enjoyment for students;
41
42

More Related Content

What's hot

Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonMaheshPandit16
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Edureka!
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on pythonwilliam john
 
Apresentação python fábio jr alves
Apresentação python   fábio jr alvesApresentação python   fábio jr alves
Apresentação python fábio jr alvesGrupython Ufla
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabusSugantha T
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)guobichrng
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Edureka!
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonManishJha237
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Fariz Darari
 
Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)IoT Code Lab
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | EdurekaEdureka!
 

What's hot (20)

Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Python ppt
Python pptPython ppt
Python ppt
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Apresentação python fábio jr alves
Apresentação python   fábio jr alvesApresentação python   fábio jr alves
Apresentação python fábio jr alves
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Python programming
Python  programmingPython  programming
Python programming
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)
 
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
 
Python basics
Python basicsPython basics
Python basics
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 

Similar to python into.pptx

python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdfgmadhu8
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPTShivam Gupta
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
 
python presentation
python presentationpython presentation
python presentationVaibhavMawal
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfYadavHarshKr
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Languageanaveenkumar4
 
Python intro
Python introPython intro
Python introrik0
 
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdfREPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdfSana Khan
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyTIB Academy
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptxHaythamBarakeh1
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 courseHimanshuPanwar38
 

Similar to python into.pptx (20)

python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Python
PythonPython
Python
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
python presentation
python presentationpython presentation
python presentation
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Introduction python
Introduction pythonIntroduction python
Introduction python
 
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
 
Python intro
Python introPython intro
Python intro
 
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdfREPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 

Recently uploaded

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 

Recently uploaded (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

python into.pptx

  • 2. What We Give you? 2 • What is Python…? • Differences between program and scripting language • History of Python • Scope of Python • What can I do with python • Who uses python today • Why do people use Python? • Installing Python IDE • ASample Code • Python code execution • Running Python • Python Basic(Variable, Strings, Data types etc.)
  • 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 3
  • 4. Differences between program and scripting language 4 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 5 • 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 programmers need. Too much freedom and nobody can read another's code; too little and expressiveness is endangered.” - Guido van Rossum 6
  • 7. Why was python created? 7 "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 administration utilities in C was taking too in the Bourne long. 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 8 • Science - Bioinformatics • SystemAdministration -Unix -Web logic -Web sphere • Web Application Development -CGI -Jython – Servlets • Testing scripts
  • 9. What can I do with Python…? 9 • System programming • Graphical User Interface Programming • Internet Scripting • Component Integration • Database Programming • Gaming, Images, XML , Robot and more
  • 10. Who uses python today… 10 • 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
  • 11. Why do people use Python…? 11 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. . • It's free (open source) Downloading and installing Python is free and easy Source code is easily accessible
  • 12. • 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. 12
  • 13. Installing Python 13 • 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
  • 14. • 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
  • 15. 15
  • 16. Running Python 16 Once you're inside the Python interpreter, type in commands at will. • Examples: >>> print 'Hello world' Hello world
  • 17. 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) 17
  • 19. Math Try typing this into Code: >>> print 3 + 12 15 >>> print 12 – 3 9 >>> print 9 + 5 – 15 + 12 11 Operators: add: + subtract: - Note: don’t type the arrows >>> ! 19
  • 20. Math Rule: If you want Python to answer in floats, you have to talk to it in floats. More operators: divide: / multiply: * >>> print 3 * 12 >>> print 12 / 3 >>> print 11 / 3 >>> print 12.0 / 3.0 >>> print 11.0 / 3.0 36 4 3 4.0 3.66 20
  • 21. Math 21 Practice: >>> print 2 < 3 True >>> print 2 <= 2 False >>> print 3 > 2 True >>> print 2 != 3 True >>> print False < True True
  • 23. Strings 23 Examples: Try typing one without quotes: What’s the result? >>> “It’s a beautiful day!” >>> “Goodbye, cruel world.” >>> Aggies >>> “Aggies” >>> “Rice fight, never die!” >>> “3 + 2”
  • 24. Strings 24 String operators: concatenation: + multiplication: * Try concatenating: Try multiplying: >>> “ “ print “Hello” + “world!” + >>> 250 print “HAHA” *
  • 26. Variable 26 Create a Variable: >>>headmaster=“Dumbledore” >>>print headmaster ‘Dumbledore’ Assigning a New Value: >>>headmaster=“Hardcastle” >>>print headmaster ‘Hardcastle’
  • 27. DATA TYPES IN PYTHON
  • 28. Data Type: 28 Python has many native data types. Here are the important ones: Booleans are either True or False. Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions (1/2 and 2/3), or even complex numbers. Strings are sequences of Unicode characters, e.g. an HTML document. Bytes and byte arrays, e.g. a JPEG image file. Lists are ordered sequences of values. Tuples are ordered, immutable sequences of values. Sets are unordered bags of values.
  • 29. Example: 29 String Integer Float List “Whoop!” 42 3.14159 [“John”, “Paul”, “George”, “Ringo”] Python can tell us about types using the type() function: >>> print type(“Whoop!”) <type ‘str’>
  • 31. List: 31 The list is a most versatile Data type available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type. Example: list1 = ['physics', 'chemistry', 1997, 2000]; list2 = [1, 2, 3, 4, 5 ];
  • 32. SN Function with Description 1 cmp(list1, list2) Compares elements of both lists. 2 len(list) Gives the total length of the list. 3 max(list) Returns item from the list with max value. 4 min(list) Returns item from the list with min value. 5 list(seq) Converts a tuple into list. 32
  • 33. List: a sequence of objects 33 >>> Beatles = [“John”, “Paul”, “George”, “Ringo”] >>> grades = [82, 93, 67, 99, 100] Guess what this will output: >>> type(Beatles) >>> type(grades)
  • 34. Lists Index: Where an item is in the list 34 >>> Beatles = [“John”, “Paul”, “George”, “Ringo”] >>> Beatles[0] ‘John‘ [“John”, “Paul”, “George”, “Ringo”] 0 1 2 3 Python always starts at zero!
  • 36. Tuples: 36 A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas lists use square brackets. Example: tup2 = (1, 2, 3, 4, 5 ); tup3 = ("a", "b", "c", "d“); Accessing Values: print "tup2[1:5]: “ Output: tup2[1:5]: [2, 3, 4, 5]
  • 37. Built-in Tuple Functions 37 Python includes the following tuple functions − SN Function with Description 1 cmp(tuple1, tuple2) Compares elements of both tuples. 2 len(tuple) Gives the total length of the tuple. 3 max(tuple) Returns item from the tuple with max value. 4 min(tuple) Returns item from the tuple with min value. 5 tuple(seq) Converts a list into tuple.
  • 39. 39 Loop Type Description while loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. for loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. nested loops You can use one or more loop inside any another while, for or do..while loop.
  • 40. Statement Description if statements An if statement consists of a boolean expression followed by one or more statements. if...else statements An if statement can be followed by an optional else statement, which executes when the boolean expression is FALSE. nested if statements You can use one if or else if statement inside another if or else if statement(s). 40
  • 41. I believe the trial has shown conclusively that it is both possible and desirable to use Python as the principal teaching language: o It is Free (as in both cost and source code). o It is trivial to install on a Windows PC allowing students to take their interest further. For many the hurdle of installing a Pascal or C compiler on a Windows machine is either too expensive or too complicated; o It is a flexible tool that allows both the teaching of traditional procedural programming and modern OOP; It can be used to teach a large number of transferable skills; o It is a real-world programming language that can be and is used in academia and the commercial world; o It appears to be quicker to learn and, in combination with its many libraries, this offers the possibility of more rapid student development allowing the course to be made more challenging and varied; o and most importantly, its clean syntax offers increased understanding and enjoyment for students; 41
  • 42. 42