SlideShare une entreprise Scribd logo
1  sur  10
Introduction to Python


“To describe something as clever is NOT considered
a compliment in the Python culture.” Alex Martelli, Python
Cookbook (2nd ed., p. 230)




                        Prepared by:
       Amgad Mohamed | Hussein Mohamed | Yasser Mohsen
Brief Introduction
– Python is a general-purpose, high-level programming
  language whose design philosophy emphasizes code
  readability.
– Python claims to "combine remarkable power with
  very clear syntax", along with a huge standard
  library with the uniqueness of using indentation as a
  block delimiters.
– Python had three major releases to support multiple
  programming paradigms including Object Oriented
  Programming, Imperative programming and
  Functional programming. Additionally, it features a
  fully dynamic typing systems and automatic garbage
  collection.
Quick History
– Python was conceived in the late 1980s, and its
  implementation was started in December 1989 by Guido
  van Rossum.

– Python 2.0 was released on 16 October 2000, with many
  major new features including a full garbage collector and
  support for Unicode.

– Python 3.0 (also known as Python 3000 or py3k), a major,
  backwards-incompatible release, was released on 3
  December 2008.
   • Python 3.0 was developed with the same philosophy as in prior
     versions. However, as Python had accumulated new and redundant
     ways to program the same task, Python 3.0 had an emphasis on
     removing duplicative constructs and modules, in keeping with "There
     should be one and preferably only one obvious way to do it".
Advantages / Disadvantages
 I.      Supports multiple paradigms.
 II.     Less code To Achieve More (Expressiveness)
 III.    Support Libraries (Extendibility)
 IV.     High productivity
        A.    Less time to code and since there is no compilation step; the edit-
             test-debug cycle is incredibly fast.
        B.   Anecdotal evidence suggests that one Python programmer can finish
             in two months what two C++ programmers can't complete in a year,
             Python code is often 5-10 times shorter than equivalent C++ code.
        C.   Python programs are typically 3-5 times shorter than equivalent Java
             programs.
 V.      Auto Memory Management and Exception Handling.

I. Compared to other programming languages, Python performance (time
and space), is way behind, Hard to Translate, and lack of documentation.
Benchmarking
Translation
– Python Code is compiled to byte code similar
  to Java, and then this Byte code is interpreted
  to the underlying machine language. (Pseudo
  Interpreter)

– This byte code provides
  • portability.
  • speed execution - byte code can be run much
    more quickly than the original source code
Sample Code - GCD
def gcd(a, b):
  "greatest common divisor"
  while a != 0:
     a, b = b%a, a  # parallel assignment
  return b
Zen of Python (Easter Egg)
•   Beautiful is better than ugly.
•   Explicit is better than implicit.
•   Simple is better than complex.
•   Complex is better than complicated.
•   Flat is better than nested.
•   Sparse is better than dense.
•   Readability counts.
•   Special cases aren't special enough to break the rules.
•   Although practicality beats purity.
•   Errors should never pass silently
•   Unless explicitly silenced.
•   In the face of ambiguity, refuse the temptation to guess.
•   There should be one-- and preferably only one --obvious way to do it.
•   Although that way may not be obvious at first unless you're Dutch.
•   Now is better than never.
•   Although never is often better than *right* now.
•   If the implementation is hard to explain, it's a bad idea.
•   If the implementation is easy to explain, it may be a good idea.
•   Namespaces are one honking great idea -- let's do more of those!
References
• [1] http://docs.python.org/faq/general.html#what-is-python-good-for.
  Retrieved 2011-10-04
• [2] http://www.python.org/doc/essays/blurb/ Python
  documentation. Retrieved 2011-10-04.
• [3] http://docs.python.org/faq/general#what-is-python Retrieved
  2011-10-04
• [4] http://www.artima.com/intv/pythonP.html Retrieved 2011-10-04
• [5] http://docs.python.org/license.html Retrieved 2011-10-04
• [6] http://python.org/download/releases/3.0/ Retrieved 2011-10-04
• [7]http://ugweb.cs.ualberta.ca/~c410/F07/410/presentations/ReportP
  ython.pdf
• [8] Learning Python 4th Ed, Mark Lutz
• [9] Core Python Programming 2nd Edition, Wesley J. Chun - Sep
  2006
• [10] Python Enhancement Proposals, 20 -- The Zen of Python.

Contenu connexe

Tendances

Python Type Hints
Python Type HintsPython Type Hints
Python Type Hints
Igor Leroy
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 

Tendances (20)

Introduction Jupyter Notebook
Introduction Jupyter NotebookIntroduction Jupyter Notebook
Introduction Jupyter Notebook
 
Python for the C# developer
Python for the C# developerPython for the C# developer
Python for the C# developer
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for Engineers
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Raspberry using Python Session 3
Raspberry using Python Session 3Raspberry using Python Session 3
Raspberry using Python Session 3
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Python Type Hints
Python Type HintsPython Type Hints
Python Type Hints
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Introduction to python lecture (1)
Introduction to python lecture (1)Introduction to python lecture (1)
Introduction to python lecture (1)
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
 
Introduction to python
 Introduction to python Introduction to python
Introduction to python
 
Why Python?
Why Python?Why Python?
Why Python?
 
Four Python Pains
Four Python PainsFour Python Pains
Four Python Pains
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Why learn python in 2017?
Why learn python in 2017?Why learn python in 2017?
Why learn python in 2017?
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net Developer
 
Python
PythonPython
Python
 
Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of Python
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 

En vedette

Design Cycle
Design CycleDesign Cycle
Design Cycle
slchua16
 
Android Performance Best Practices
Android Performance Best Practices Android Performance Best Practices
Android Performance Best Practices
Amgad Muhammad
 
Unsupervised Feature Learning
Unsupervised Feature LearningUnsupervised Feature Learning
Unsupervised Feature Learning
Amgad Muhammad
 

En vedette (14)

The man
The manThe man
The man
 
Q3 pitch
Q3 pitchQ3 pitch
Q3 pitch
 
Corba
CorbaCorba
Corba
 
Tough Mudder "post event blog"
Tough Mudder "post event blog"Tough Mudder "post event blog"
Tough Mudder "post event blog"
 
Posters
PostersPosters
Posters
 
Design Cycle
Design CycleDesign Cycle
Design Cycle
 
CUDA and Caffe for deep learning
CUDA and Caffe for deep learningCUDA and Caffe for deep learning
CUDA and Caffe for deep learning
 
The man
The manThe man
The man
 
Android Performance Best Practices
Android Performance Best Practices Android Performance Best Practices
Android Performance Best Practices
 
RecSports Rebrand
RecSports RebrandRecSports Rebrand
RecSports Rebrand
 
Auto-Encoders and PCA, a brief psychological background
Auto-Encoders and PCA, a brief psychological backgroundAuto-Encoders and PCA, a brief psychological background
Auto-Encoders and PCA, a brief psychological background
 
Unsupervised Feature Learning
Unsupervised Feature LearningUnsupervised Feature Learning
Unsupervised Feature Learning
 
Google File System
Google File SystemGoogle File System
Google File System
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Similaire à Python

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
HassanShah396906
 
Welcome to the Brixton Library Technology Initiative
Welcome to the Brixton Library Technology InitiativeWelcome to the Brixton Library Technology Initiative
Welcome to the Brixton Library Technology Initiative
Basil Bibi
 

Similaire à Python (20)

Python Programming1.ppt
Python Programming1.pptPython Programming1.ppt
Python Programming1.ppt
 
What is python
What is pythonWhat is python
What is python
 
Doing the Impossible
Doing the ImpossibleDoing the Impossible
Doing the Impossible
 
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
 
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
 
Welcome to the Brixton Library Technology Initiative
Welcome to the Brixton Library Technology InitiativeWelcome to the Brixton Library Technology Initiative
Welcome to the Brixton Library Technology Initiative
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
Introduction-to-Python.pptx
Introduction-to-Python.pptxIntroduction-to-Python.pptx
Introduction-to-Python.pptx
 
Python programming
Python programmingPython programming
Python programming
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
Python 3.5: An agile, general-purpose development language.
Python 3.5: An agile, general-purpose development language.Python 3.5: An agile, general-purpose development language.
Python 3.5: An agile, general-purpose development language.
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming Basics
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"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 ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Python

  • 1. Introduction to Python “To describe something as clever is NOT considered a compliment in the Python culture.” Alex Martelli, Python Cookbook (2nd ed., p. 230) Prepared by: Amgad Mohamed | Hussein Mohamed | Yasser Mohsen
  • 2.
  • 3. Brief Introduction – Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. – Python claims to "combine remarkable power with very clear syntax", along with a huge standard library with the uniqueness of using indentation as a block delimiters. – Python had three major releases to support multiple programming paradigms including Object Oriented Programming, Imperative programming and Functional programming. Additionally, it features a fully dynamic typing systems and automatic garbage collection.
  • 4. Quick History – Python was conceived in the late 1980s, and its implementation was started in December 1989 by Guido van Rossum. – Python 2.0 was released on 16 October 2000, with many major new features including a full garbage collector and support for Unicode. – Python 3.0 (also known as Python 3000 or py3k), a major, backwards-incompatible release, was released on 3 December 2008. • Python 3.0 was developed with the same philosophy as in prior versions. However, as Python had accumulated new and redundant ways to program the same task, Python 3.0 had an emphasis on removing duplicative constructs and modules, in keeping with "There should be one and preferably only one obvious way to do it".
  • 5. Advantages / Disadvantages I. Supports multiple paradigms. II. Less code To Achieve More (Expressiveness) III. Support Libraries (Extendibility) IV. High productivity A. Less time to code and since there is no compilation step; the edit- test-debug cycle is incredibly fast. B. Anecdotal evidence suggests that one Python programmer can finish in two months what two C++ programmers can't complete in a year, Python code is often 5-10 times shorter than equivalent C++ code. C. Python programs are typically 3-5 times shorter than equivalent Java programs. V. Auto Memory Management and Exception Handling. I. Compared to other programming languages, Python performance (time and space), is way behind, Hard to Translate, and lack of documentation.
  • 7. Translation – Python Code is compiled to byte code similar to Java, and then this Byte code is interpreted to the underlying machine language. (Pseudo Interpreter) – This byte code provides • portability. • speed execution - byte code can be run much more quickly than the original source code
  • 8. Sample Code - GCD def gcd(a, b): "greatest common divisor" while a != 0: a, b = b%a, a # parallel assignment return b
  • 9. Zen of Python (Easter Egg) • Beautiful is better than ugly. • Explicit is better than implicit. • Simple is better than complex. • Complex is better than complicated. • Flat is better than nested. • Sparse is better than dense. • Readability counts. • Special cases aren't special enough to break the rules. • Although practicality beats purity. • Errors should never pass silently • Unless explicitly silenced. • In the face of ambiguity, refuse the temptation to guess. • There should be one-- and preferably only one --obvious way to do it. • Although that way may not be obvious at first unless you're Dutch. • Now is better than never. • Although never is often better than *right* now. • If the implementation is hard to explain, it's a bad idea. • If the implementation is easy to explain, it may be a good idea. • Namespaces are one honking great idea -- let's do more of those!
  • 10. References • [1] http://docs.python.org/faq/general.html#what-is-python-good-for. Retrieved 2011-10-04 • [2] http://www.python.org/doc/essays/blurb/ Python documentation. Retrieved 2011-10-04. • [3] http://docs.python.org/faq/general#what-is-python Retrieved 2011-10-04 • [4] http://www.artima.com/intv/pythonP.html Retrieved 2011-10-04 • [5] http://docs.python.org/license.html Retrieved 2011-10-04 • [6] http://python.org/download/releases/3.0/ Retrieved 2011-10-04 • [7]http://ugweb.cs.ualberta.ca/~c410/F07/410/presentations/ReportP ython.pdf • [8] Learning Python 4th Ed, Mark Lutz • [9] Core Python Programming 2nd Edition, Wesley J. Chun - Sep 2006 • [10] Python Enhancement Proposals, 20 -- The Zen of Python.