SlideShare a Scribd company logo
BITS Pilani
Pilani Campus
Dhanashree N P
Lecturer (Off-Campus) Computer Science
'Hello, World!' with Python
04-01-2017
DISCLAIMER
This is NOT a Python programming tutorial!!
Session Overview
1. The clichéd title
2. Python & PSF
3. Features of Python
4. Success stories: using Python
5. Sample programs
6. FAQs
7. Python programs are ‘slow’ – Myth?
8. Why is Python preferred by many?
9. Reference Links
The clichéd title
Any programming tutorial starts with a ‘Hello, World!’ program.
Let’s use the same to answer ‘Why Python?’
Python & PSF
• “hobby” programming
project
• Interpreter for a
scripting language
Dec 1989
• Python 2.0 – 16th Oct
• Unicode Support, cycle-
detecting GC
Oct 2000 • Python 3.0
• Backward-Incompatible
• Features backported to
backward compatible
2.7.x, 2.6.x
Dec 2008
Guido van Rossum – creator of Python
– benevolent dictator for life (BDFL)
Python Software Foundation(PSF) - manages the open-source licensing for Python 2.1 and later
- mission is to promote, protect and advance Python; support
and facilitate growth of international & diverse community of Python programmers. [2001]
Python: Features
6
Language
Features
High-
level
General
Purpose
Multi-
Paradigm
Interpreted
Fully
Supported
• Object-oriented Programming
• Structured Programming
Supported
by Language
Features
• Functional Programming
• Aspect Oriented Programming
Supported
by
Extensions
• Design by Contract
• Logic Programming
Python: Features
7
Features
Dynamic
typing
Late
binding
ExtensibleWhite
Spaces
Automatic
Memory
Management
The name Python was inspired from the series Monty Python’s Flying Circus
a = 3
a = “a string”
a = [‘a’, ‘list’]
len(a)
Success Stories using Python
8
Web &
Analysis
• Mozilla
• Google
• Youtube
• Bitly
• ForecastWatch
.com etc
Science,
Energy
•ExpEYES [portable
scientific laboratory]
•VAMPZero [aircraft
conceptual design]
• Eco Mode @ SMS
Siemag AG
• Large Hadron
Collider (CERN)
•EPRI (Life on Mars -
ESA) [Python
powered clusters
and graphics
processing]
Animation &
Graphics
• Blender
• Houdini
Systems
Cloud, Data
Centers etc.
• Open Stack
• Google App
Engine
• Flying Circus
• rackspace
Others
• Scientific &
Numeric
Processing –
SciPy, NumPy
• Machine
Learning &
Analytics –
SocialCorps,
Innoplexus,
Fractal Analysis
• Automation of
applications [
Jython]Oracle
in ODI
A few lines of code..
9
Examples shown use Python 2.7.12
A simple word-count program – Python shell/command line
A simple word-count program using the os module – Python shell/command line
A few more lines of code..
10
Examples shown use Python 2.7.12
Code to check the word count limit for multiple files
Save this code in a file as pgm.py
From the command line (Linux) – execute it using: python pgm.py
Or from within IDLE shell - execfile('pgm.py')
A few FAQs
11
1. What version to choose – 2.7.x or 3.x?
https://wiki.python.org/moin/Python2orPython3
2. What to use for development?
1. Any text editor (from notepad to Sublime Text)
2. IDE (Eric, Pycharm)
3. Online Web Application: Jupyter (iPython)
3. How to run?
1. Use the command line  python filename [arguments]
2. Use the Python shell  execfile(filename[,arguments])
4. How to debug?
pdb module https://docs.python.org/2/library/pdb.html
Is Python ‘slow’ ? Why?
12
Yes – most of the raw code is slower than C/C++. But it is faster
than Ruby/JavaScript [Source: Internet]
A few reasons are:
1. Dynamic v/s Static typing
2. Interpreted v/s Compiled
3. Inefficient memory access due to its object model (list
access)
But there are hacks to overcome these: vectorised operations
[SciPy, NumPy etc.], calling compiled code, using specific
libraries etc.
Read more at: https://jakevdp.github.io/blog/2014/05/09/why-python-is-slow/
Why not something else?
Source: https://www.python.org/about/
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Questions?
Source: https://www.explainxkcd.com/wiki/index.php/353:_Python
BITS Pilani, Pilani Campus
Python – About, Documentation, Downloads etc. - https://www.python.org/
Python Software Foundation - https://www.python.org/psf/
Logos and Usage - https://www.python.org/community/logos/
History and Timelines -
https://en.wikipedia.org/wiki/Python_(programming_language)
Some Success Stories and Case studies -
http://brochure.getpython.info/media/releases/psf-python-brochure-vol.-i-
final-download.pdf/at_download/file
Some Tutorials/Books to start with:
The Python Tutorial https://docs.python.org/3/tutorial/
LearnPython.org http://www.learnpython.org/
Think Python: How to Think Like a Computer Scientist – Allen. B.
Downey http://www.greenteapress.com/thinkpython/html/
Python Playground: Geeky Projects for the curious Programmer –
Mahesh Venkitachalam https://www.nostarch.com/pythonplayground
Reference Links
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
17

More Related Content

PPTX
Introduction to python programming, Why Python?, Applications of Python
Pro Guide
 
PPTX
First python project
Neetu Jain
 
PDF
Introduction to python
Agung Wahyudi
 
PPTX
Introduction to python
AnirudhaGaikwad4
 
PDF
Python course syllabus
Sugantha T
 
PDF
Introduction to python programming
Kiran Vadakkath
 
PDF
Introduction to python
Rajesh Rajamani
 
PPTX
Introduction to python
ManishJha237
 
Introduction to python programming, Why Python?, Applications of Python
Pro Guide
 
First python project
Neetu Jain
 
Introduction to python
Agung Wahyudi
 
Introduction to python
AnirudhaGaikwad4
 
Python course syllabus
Sugantha T
 
Introduction to python programming
Kiran Vadakkath
 
Introduction to python
Rajesh Rajamani
 
Introduction to python
ManishJha237
 

What's hot (20)

PDF
Introduction to python
Learnbay Datascience
 
PPT
Python Introduction
Sofian Hadiwijaya
 
PDF
Python, the Language of Science and Engineering for Engineers
Boey Pak Cheong
 
PPTX
IHTM Python PCEP Introduction to Python
IHTMINSTITUTE
 
PDF
Introduction To Python
Vanessa Rene
 
PDF
Python for the C# developer
Michael Kennedy
 
PPTX
Python 101 For The Net Developer
Sarah Dutkiewicz
 
PPTX
Introduction to python for Beginners
Sujith Kumar
 
PPT
Python Introduction
Mohammad Javad Beheshtian
 
PPTX
Python tutorial for beginners - Tib academy
TIB Academy
 
PDF
A commercial open source project in Python
jbrendel
 
PDF
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Edureka!
 
PDF
Python: the Project, the Language and the Style
Juan-Manuel Gimeno
 
PPT
Python Programming ppt
ismailmrribi
 
PPTX
Python programming
Megha V
 
PPTX
Python 101 for the .NET Developer
Sarah Dutkiewicz
 
PDF
Introduction to Python
DrMohammed Qassim
 
PDF
Writing Fast Code (JP) - PyCon JP 2015
Younggun Kim
 
PDF
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov
 
Introduction to python
Learnbay Datascience
 
Python Introduction
Sofian Hadiwijaya
 
Python, the Language of Science and Engineering for Engineers
Boey Pak Cheong
 
IHTM Python PCEP Introduction to Python
IHTMINSTITUTE
 
Introduction To Python
Vanessa Rene
 
Python for the C# developer
Michael Kennedy
 
Python 101 For The Net Developer
Sarah Dutkiewicz
 
Introduction to python for Beginners
Sujith Kumar
 
Python Introduction
Mohammad Javad Beheshtian
 
Python tutorial for beginners - Tib academy
TIB Academy
 
A commercial open source project in Python
jbrendel
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Edureka!
 
Python: the Project, the Language and the Style
Juan-Manuel Gimeno
 
Python Programming ppt
ismailmrribi
 
Python programming
Megha V
 
Python 101 for the .NET Developer
Sarah Dutkiewicz
 
Introduction to Python
DrMohammed Qassim
 
Writing Fast Code (JP) - PyCon JP 2015
Younggun Kim
 
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov
 
Ad

Viewers also liked (17)

PDF
MPI Tutorial
Dhanashree Prasad
 
PDF
OpenMP Tutorial for Beginners
Dhanashree Prasad
 
PPTX
Python Hype June
Brian Ray
 
ODP
James Jesus Bermas on Crash Course on Python
CP-Union
 
PDF
Pydata-Python tools for webscraping
Jose Manuel Ortega Candel
 
PPTX
Data analysis with pandas
Outreach Digital
 
PPTX
Python Hype?
Brian Ray
 
PPTX
Wellcome to python
Nanra Sukedy
 
PDF
Bringing Down the House - How One Python Script Ruled Over AntiVirus
CTruncer
 
PDF
Public Outreach - Running an effective campaign
Partners in Emergency Preparedness Conference
 
PPTX
Intro to Python Programming Language
Dipankar Achinta
 
PDF
Building an EmPyre with Python
Will Schroeder
 
PPTX
Introduction about Python by JanBask Training
JanBask Training
 
PPTX
Presentation of Python, Django, DockerStack
David Sanchez
 
PPTX
Python and Data Evangelism
Won Bae Suh
 
PPTX
Web scraping com python
Matheus Fidelis
 
MPI Tutorial
Dhanashree Prasad
 
OpenMP Tutorial for Beginners
Dhanashree Prasad
 
Python Hype June
Brian Ray
 
James Jesus Bermas on Crash Course on Python
CP-Union
 
Pydata-Python tools for webscraping
Jose Manuel Ortega Candel
 
Data analysis with pandas
Outreach Digital
 
Python Hype?
Brian Ray
 
Wellcome to python
Nanra Sukedy
 
Bringing Down the House - How One Python Script Ruled Over AntiVirus
CTruncer
 
Public Outreach - Running an effective campaign
Partners in Emergency Preparedness Conference
 
Intro to Python Programming Language
Dipankar Achinta
 
Building an EmPyre with Python
Will Schroeder
 
Introduction about Python by JanBask Training
JanBask Training
 
Presentation of Python, Django, DockerStack
David Sanchez
 
Python and Data Evangelism
Won Bae Suh
 
Web scraping com python
Matheus Fidelis
 
Ad

Similar to Hello World! with Python (20)

PDF
Introduction to python 3
Youhei Sakurai
 
PPT
Pythonintroduction
-jyothish kumar sirigidi
 
PPT
Python for students step by step guidance
MantoshKumar79
 
PPT
python-ppt.ppt
MohammadSamiuddin10
 
PPT
python-ppt.ppt
MohammadSamiuddin10
 
PDF
Python tutorial
Vijay Chaitanya
 
PPTX
Python programming language introduction unit
michaelaaron25322
 
PDF
session5-Getting stated with Python.pdf
AyushDutta32
 
PPT
1-ppt-python.ppt
ssusera99a83
 
PDF
Introduction to Python
SudhanshiBakre1
 
PPT
Introduction to python
Syed Zaid Irshad
 
PDF
Introduction to python 3 2nd round
Youhei Sakurai
 
PDF
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
PDF
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
PDF
Introduction to python
Mohammed Rafi
 
PPTX
Python PPT by Sushil Sir.pptx
sushil155005
 
PDF
Introduction To Python For Beginners
TechVidvan
 
PDF
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
PPTX
What is python
faizrashid1995
 
PPTX
Lecture on Fundamentals of Python Programming-1
JannatulFerdouse15
 
Introduction to python 3
Youhei Sakurai
 
Pythonintroduction
-jyothish kumar sirigidi
 
Python for students step by step guidance
MantoshKumar79
 
python-ppt.ppt
MohammadSamiuddin10
 
python-ppt.ppt
MohammadSamiuddin10
 
Python tutorial
Vijay Chaitanya
 
Python programming language introduction unit
michaelaaron25322
 
session5-Getting stated with Python.pdf
AyushDutta32
 
1-ppt-python.ppt
ssusera99a83
 
Introduction to Python
SudhanshiBakre1
 
Introduction to python
Syed Zaid Irshad
 
Introduction to python 3 2nd round
Youhei Sakurai
 
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
Introduction to python
Mohammed Rafi
 
Python PPT by Sushil Sir.pptx
sushil155005
 
Introduction To Python For Beginners
TechVidvan
 
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
What is python
faizrashid1995
 
Lecture on Fundamentals of Python Programming-1
JannatulFerdouse15
 

Recently uploaded (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PDF
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PDF
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPT
Order to Cash Lifecycle Overview R12 .ppt
nbvreddy229
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Order to Cash Lifecycle Overview R12 .ppt
nbvreddy229
 

Hello World! with Python

  • 1. BITS Pilani Pilani Campus Dhanashree N P Lecturer (Off-Campus) Computer Science 'Hello, World!' with Python 04-01-2017
  • 2. DISCLAIMER This is NOT a Python programming tutorial!!
  • 3. Session Overview 1. The clichéd title 2. Python & PSF 3. Features of Python 4. Success stories: using Python 5. Sample programs 6. FAQs 7. Python programs are ‘slow’ – Myth? 8. Why is Python preferred by many? 9. Reference Links
  • 4. The clichéd title Any programming tutorial starts with a ‘Hello, World!’ program. Let’s use the same to answer ‘Why Python?’
  • 5. Python & PSF • “hobby” programming project • Interpreter for a scripting language Dec 1989 • Python 2.0 – 16th Oct • Unicode Support, cycle- detecting GC Oct 2000 • Python 3.0 • Backward-Incompatible • Features backported to backward compatible 2.7.x, 2.6.x Dec 2008 Guido van Rossum – creator of Python – benevolent dictator for life (BDFL) Python Software Foundation(PSF) - manages the open-source licensing for Python 2.1 and later - mission is to promote, protect and advance Python; support and facilitate growth of international & diverse community of Python programmers. [2001]
  • 6. Python: Features 6 Language Features High- level General Purpose Multi- Paradigm Interpreted Fully Supported • Object-oriented Programming • Structured Programming Supported by Language Features • Functional Programming • Aspect Oriented Programming Supported by Extensions • Design by Contract • Logic Programming
  • 7. Python: Features 7 Features Dynamic typing Late binding ExtensibleWhite Spaces Automatic Memory Management The name Python was inspired from the series Monty Python’s Flying Circus a = 3 a = “a string” a = [‘a’, ‘list’] len(a)
  • 8. Success Stories using Python 8 Web & Analysis • Mozilla • Google • Youtube • Bitly • ForecastWatch .com etc Science, Energy •ExpEYES [portable scientific laboratory] •VAMPZero [aircraft conceptual design] • Eco Mode @ SMS Siemag AG • Large Hadron Collider (CERN) •EPRI (Life on Mars - ESA) [Python powered clusters and graphics processing] Animation & Graphics • Blender • Houdini Systems Cloud, Data Centers etc. • Open Stack • Google App Engine • Flying Circus • rackspace Others • Scientific & Numeric Processing – SciPy, NumPy • Machine Learning & Analytics – SocialCorps, Innoplexus, Fractal Analysis • Automation of applications [ Jython]Oracle in ODI
  • 9. A few lines of code.. 9 Examples shown use Python 2.7.12 A simple word-count program – Python shell/command line A simple word-count program using the os module – Python shell/command line
  • 10. A few more lines of code.. 10 Examples shown use Python 2.7.12 Code to check the word count limit for multiple files Save this code in a file as pgm.py From the command line (Linux) – execute it using: python pgm.py Or from within IDLE shell - execfile('pgm.py')
  • 11. A few FAQs 11 1. What version to choose – 2.7.x or 3.x? https://wiki.python.org/moin/Python2orPython3 2. What to use for development? 1. Any text editor (from notepad to Sublime Text) 2. IDE (Eric, Pycharm) 3. Online Web Application: Jupyter (iPython) 3. How to run? 1. Use the command line  python filename [arguments] 2. Use the Python shell  execfile(filename[,arguments]) 4. How to debug? pdb module https://docs.python.org/2/library/pdb.html
  • 12. Is Python ‘slow’ ? Why? 12 Yes – most of the raw code is slower than C/C++. But it is faster than Ruby/JavaScript [Source: Internet] A few reasons are: 1. Dynamic v/s Static typing 2. Interpreted v/s Compiled 3. Inefficient memory access due to its object model (list access) But there are hacks to overcome these: vectorised operations [SciPy, NumPy etc.], calling compiled code, using specific libraries etc. Read more at: https://jakevdp.github.io/blog/2014/05/09/why-python-is-slow/
  • 13. Why not something else? Source: https://www.python.org/about/
  • 14. BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 Questions?
  • 16. BITS Pilani, Pilani Campus Python – About, Documentation, Downloads etc. - https://www.python.org/ Python Software Foundation - https://www.python.org/psf/ Logos and Usage - https://www.python.org/community/logos/ History and Timelines - https://en.wikipedia.org/wiki/Python_(programming_language) Some Success Stories and Case studies - http://brochure.getpython.info/media/releases/psf-python-brochure-vol.-i- final-download.pdf/at_download/file Some Tutorials/Books to start with: The Python Tutorial https://docs.python.org/3/tutorial/ LearnPython.org http://www.learnpython.org/ Think Python: How to Think Like a Computer Scientist – Allen. B. Downey http://www.greenteapress.com/thinkpython/html/ Python Playground: Geeky Projects for the curious Programmer – Mahesh Venkitachalam https://www.nostarch.com/pythonplayground Reference Links
  • 17. BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 17