SlideShare a Scribd company logo
1 of 38
PYTHON
Speaker Arpit tripathi.
KGI Kanpur
B tech second year student{CSE}
What We Give you?
• 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
• A Sample 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
Differences between program and scripting
language
Program Scripting
• a program is executed (i.e a script is interpreted
the source is first compiled, A “script” is code written
and the result of that compi in a language A scripting
lation is expected) language is nothing but a
• A "program" in general, is type of programming langua
a sequence of instructions ge in which we can write c
written so that a computer ode to control another soft
can perform certain task. Ware 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 free
• dom programmers need. Too much freedom and
• nobody can read another's code; too little and
• expressiveness 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
What can I do with Python?
• System programming
• Graphical User Interface Programming
• Internet Scripting
• Component Integration
• Database Programming
• Gaming, Images, XML , Robot and more
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
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. .
• 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
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 3.9.1 only
Running Python
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
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)
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 >>> !
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 36
• >>> print 12 / 3 4
• >>> print 11 / 3 3
• >>> print 12.0 / 3.0 4.0
• >>> print 11.0 / 3.0 3.66
Math
• Practice:
• >>> print 2 < 3 True
• >>> print 2 <= 2 False
• >>> print 3 > 2 True
• >>> print 2 != 3 True
• >>> print False < True True
STRINGS IN PYTHON
Strings
• Examples:
>>> “It’s a beautiful day!”
>>> “Goodbye, cruel world.”
Try typing one without quotes:
What’s the result >>Aggies
>>> “Aggies”
>>> “Rice fight,never
die!”
>>> “3 + 2”
Strings
• String operators:
concatenation: +
multiplication: *
Try concatenating: >>> print “Hello” +
Try multiplying: “ “ + “world!”
>>> print “HAHA” *
250
VARIABLES IN PYTHON
Variables
• Create a Variable:
>>>headmaster=“Dumbledore”
>>>print headmaster
‘Dumbledore’
Assigning a New Value:
>>>headmaster=“Hardcastle”
>>>print headmaster
‘Hardcastle
DATA TYPES IN PYTHON
Data Types:
• 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:
• String “Whoop!”
• Integer 42
• Float 3.14159
• List [“John”, “Paul”, “George”, “Ringo”]
Python can tell us about types using the type() function:
>>> print type(“Whoop!”)
<type ‘str’>
LIST: DATA TYPE
List:
• 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.
Lists
• Index: Where an item is in the list
>>> 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:
• 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]
LOOPS & CONDITIONAL STATEMENTS
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).
I believe the trial has shown conclusively that it is both possible and desirable to use
Python as the principal teaching language
• It is Free (as in both cost and source code).
• 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;
• 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;
• It is a real-world programming language that can be and is used in academia
and the commercial world;
• 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;
• and most importantly, its clean syntax offers increased understanding and
enjoyment for students;
Thank you!

More Related Content

What's hot

What's hot (20)

python presentation
python presentationpython presentation
python presentation
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python PPT
Python PPTPython PPT
Python PPT
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
 
Python programming
Python programmingPython programming
Python programming
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Python presentation by Monu Sharma
Python presentation by Monu SharmaPython presentation by Monu Sharma
Python presentation by Monu Sharma
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Programming
ProgrammingProgramming
Programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
 
Introduction to the Python
Introduction to the PythonIntroduction to the Python
Introduction to the Python
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Similar to python presntation 2.pptx

python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdfgmadhu8
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPTShivam Gupta
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1Ahmet Bulut
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxHassanShah396906
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh MalothBhavsingh Maloth
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
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
 

Similar to python presntation 2.pptx (20)

python into.pptx
python into.pptxpython into.pptx
python into.pptx
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
 
Python
PythonPython
Python
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Python_slides.pdf
Python_slides.pdfPython_slides.pdf
Python_slides.pdf
 
Python Demo.pptx
Python Demo.pptxPython Demo.pptx
Python Demo.pptx
 
Python Demo.pptx
Python Demo.pptxPython Demo.pptx
Python Demo.pptx
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
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
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 

Recently uploaded

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

python presntation 2.pptx

  • 1. PYTHON Speaker Arpit tripathi. KGI Kanpur B tech second year student{CSE}
  • 2. What We Give you? • 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 • A Sample 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
  • 4. Differences between program and scripting language Program Scripting • a program is executed (i.e a script is interpreted the source is first compiled, A “script” is code written and the result of that compi in a language A scripting lation is expected) language is nothing but a • A "program" in general, is type of programming langua a sequence of instructions ge in which we can write c written so that a computer ode to control another soft can perform certain task. Ware 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 free • dom programmers need. Too much freedom and • nobody can read another's code; too little and • expressiveness 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. What can I do with Python? • System programming • Graphical User Interface Programming • Internet Scripting • Component Integration • Database Programming • Gaming, Images, XML , Robot and more
  • 10. 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
  • 11. 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. . • 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
  • 13. 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 3.9.1 only
  • 14. Running Python Once you're inside the Python interpreter, type in commands at will. • Examples : >>> print 'Hello world‘ Hello world
  • 15. Python Code Execution • Python’s traditional runtime execution model: source code you type is 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 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 >>> !
  • 18. 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 36 • >>> print 12 / 3 4 • >>> print 11 / 3 3 • >>> print 12.0 / 3.0 4.0 • >>> print 11.0 / 3.0 3.66
  • 19. Math • Practice: • >>> print 2 < 3 True • >>> print 2 <= 2 False • >>> print 3 > 2 True • >>> print 2 != 3 True • >>> print False < True True
  • 21. Strings • Examples: >>> “It’s a beautiful day!” >>> “Goodbye, cruel world.” Try typing one without quotes: What’s the result >>Aggies >>> “Aggies” >>> “Rice fight,never die!” >>> “3 + 2”
  • 22. Strings • String operators: concatenation: + multiplication: * Try concatenating: >>> print “Hello” + Try multiplying: “ “ + “world!” >>> print “HAHA” * 250
  • 24. Variables • Create a Variable: >>>headmaster=“Dumbledore” >>>print headmaster ‘Dumbledore’ Assigning a New Value: >>>headmaster=“Hardcastle” >>>print headmaster ‘Hardcastle
  • 25. DATA TYPES IN PYTHON
  • 26. Data Types: • 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.
  • 27. Example: • String “Whoop!” • Integer 42 • Float 3.14159 • List [“John”, “Paul”, “George”, “Ringo”] Python can tell us about types using the type() function: >>> print type(“Whoop!”) <type ‘str’>
  • 29. List: • 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 ];
  • 30. 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.
  • 31. Lists • Index: Where an item is in the list >>> Beatles = [“John”, “Paul”, “George”, “Ringo”] >>> Beatles[0] ‘John‘ [“John”, “Paul”, “George”, “Ringo”] 0 1 2 3 Python always starts at zero!
  • 33. Tuples: • 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]
  • 34. LOOPS & CONDITIONAL STATEMENTS
  • 35. 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.
  • 36. 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).
  • 37. I believe the trial has shown conclusively that it is both possible and desirable to use Python as the principal teaching language • It is Free (as in both cost and source code). • 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; • 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; • It is a real-world programming language that can be and is used in academia and the commercial world; • 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; • and most importantly, its clean syntax offers increased understanding and enjoyment for students;