SlideShare a Scribd company logo
Introduction to Python
A readable, dynamic, pleasant,
flexible, fast and powerful language
Overview
• Background
• Syntax
• Types / Operators / Control Flow
• Functions
• Classes
• Tools
What is Python
• Multi-purpose (Web, GUI, Scripting, etc.)
• Object Oriented
• Interpreted
• Strongly typed and Dynamically typed
• Focus on readability and productivity
Features
• Batteries Included
• Everything is an Object
• Interactive Shell
• Strong Introspection
• Cross Platform
• CPython, Jython, IronPython, PyPy
Who Uses Python
• Google
• Youtube
• Spotify
• Nasa
• Etc
Releases
• Created in 1989 by GuidoVan Rossum
• Python 1.0 released in 1994
• Python 2.0 released in 2000
• Python 3.0 released in 2008
• Python 2.7 is the recommended version
• 3.0 adoption will take a few years
Syntax
Hello World
hello_world.py
Indentation
• Most languages don’t care about
indentation
• Most humans do
• We tend to group similar things together
Indentation
The else here actually belongs to the 2nd if statement
Indentation
The else here actually belongs to the 2nd if statement
Indentation
I knew a coder like this
Indentation
You should always be explicit
Indentation
Text
Python embraces indentation
Comments
Types
Strings
Numbers
Null
Lists
Lists
Tuple
• Tuple just like List
• But immutable
• Assignment using ( )
Dictionaries
Dictionary Methods
Booleans
Operators
Arithmetic
String Manipulation
Logical Comparison
Identity Comparison
Arithmetic Comparison
Control Flow
Conditionals
For Loop
Expanded For Loop
While Loop
List Comprehensions
• Useful for replacing simple for-loops.
Functions
Basic Function
Function Arguments
Arbitrary Arguments
Fibonacci
Fibonacci Generator
Classes
Class Declaration
Class Attributes
• Attributes assigned at class declaration
should always be immutable
Class Methods
Class Instantiation &
Attribute Access
Class Inheritance
Python’s Way
• No interfaces
• No real private attributes/functions
• Private attributes start (but do not end)
with double underscores.
• Special class methods start and end with
double underscores.
• __init__, __doc__, __cmp__, __str__
Imports
• Allows code isolation and re-use
• Adds references to
variables/classes/functions/etc. into current
namespace
Imports
More Imports
Error Handling
Documentation
Docstrings
Tools
Web Frameworks
• Django
• Flask
• Pylons
• TurboGears
• Zope
• Grok
IDEs
• Emacs
• Vim
• Komodo
• PyCharm
• Eclipse (PyDev)
Package Management
Resources
• http://python.org/
• http://diveintopython.org/
• http://djangoproject.com/
Example
Going Further
• Decorators
• Context Managers
• Lambda functions
• Generators
• ...
Questions?
Thanks!

More Related Content

PPT
Introduction to python
PPTX
PPTX
Programming
PPT
Intro to Python
PPTX
Python Course for Beginners
PPTX
Python ppt
PPTX
Python presentation by Monu Sharma
PPTX
Intro to Python Programming Language
Introduction to python
Programming
Intro to Python
Python Course for Beginners
Python ppt
Python presentation by Monu Sharma
Intro to Python Programming Language

What's hot (20)

PPTX
Introduction to python
PPTX
Introduction to python programming, Why Python?, Applications of Python
PPT
Python Programming ppt
PPT
Python ppt
PPT
programming with python ppt
PPTX
Python programming
PPTX
Beginning Python Programming
PPTX
Fundamentals of Python Programming
PDF
Introduction to python programming
PPSX
Programming with Python
PPTX
Python Tutorial Part 1
PPTX
Introduction to the Python
PPTX
Chapter 03 python libraries
PPTX
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
PDF
Python Basics
PDF
Python - the basics
PPTX
stack & queue
PPT
Basic logic gates
PPTX
Presentation on python
Introduction to python
Introduction to python programming, Why Python?, Applications of Python
Python Programming ppt
Python ppt
programming with python ppt
Python programming
Beginning Python Programming
Fundamentals of Python Programming
Introduction to python programming
Programming with Python
Python Tutorial Part 1
Introduction to the Python
Chapter 03 python libraries
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Python Basics
Python - the basics
stack & queue
Basic logic gates
Presentation on python
Ad

Similar to Python Introduction (20)

PPTX
Introduction-to-Python.pptx
PPT
452181636-Python-dsfdsfdsfdsfsdfdsfsdSeminar-1-ppt.ppt
PPT
Introduction to Python
PPT
Python intro and competitive programming
PDF
PDF
Introduction to python
PPTX
Introduction-to-Python-Programming1.pptx
PPTX
Chapter - 1.pptx
PDF
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
PPT
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
PDF
Introduction to Python Unit -1 Part .pdf
PPTX
A Brief Introduction to Python - English
PDF
Python Programing Bio computing,basic concepts lab,,
PPTX
Python final presentation kirti ppt1
PDF
05 python.pdf
PPT
program on python what is python where it was started by whom started
PPT
Python Over View (Python for mobile app Devt)1.ppt
PPT
Py-Slides-1.ppt1234444444444444444444444444444444444444444
PPT
Python slides for the beginners to learn
PPT
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Introduction-to-Python.pptx
452181636-Python-dsfdsfdsfdsfsdfdsfsdSeminar-1-ppt.ppt
Introduction to Python
Python intro and competitive programming
Introduction to python
Introduction-to-Python-Programming1.pptx
Chapter - 1.pptx
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Introduction to Python Unit -1 Part .pdf
A Brief Introduction to Python - English
Python Programing Bio computing,basic concepts lab,,
Python final presentation kirti ppt1
05 python.pdf
program on python what is python where it was started by whom started
Python Over View (Python for mobile app Devt)1.ppt
Py-Slides-1.ppt1234444444444444444444444444444444444444444
Python slides for the beginners to learn
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Ad

More from Sofian Hadiwijaya (20)

PDF
Workshop Web3 Weekend Social Impact
PDF
Warung Pintar Social Impact Report 2018
PDF
Agile and Scrum 101
PDF
Execute Idea
PDF
Product market fit and Scale
PDF
Entrepreneur Story
PPTX
Pathway became data scientist
PDF
Keynote Speaker PyConID 2018
PPTX
Building Startups
PDF
Big data and digital marketing
PDF
Data Driven Organization
PDF
Data Driven Company
PDF
serverless web application
PDF
Startup 101
PPT
IoT and AI for Retail Industry
PDF
Growth in Startup
PDF
Technology Industry
PDF
What you can get with data
PDF
DeepLearning with Neon
PDF
How BigData Affects Business
Workshop Web3 Weekend Social Impact
Warung Pintar Social Impact Report 2018
Agile and Scrum 101
Execute Idea
Product market fit and Scale
Entrepreneur Story
Pathway became data scientist
Keynote Speaker PyConID 2018
Building Startups
Big data and digital marketing
Data Driven Organization
Data Driven Company
serverless web application
Startup 101
IoT and AI for Retail Industry
Growth in Startup
Technology Industry
What you can get with data
DeepLearning with Neon
How BigData Affects Business

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Machine Learning_overview_presentation.pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Tartificialntelligence_presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectroscopy.pptx food analysis technology
Machine Learning_overview_presentation.pptx
1. Introduction to Computer Programming.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
Tartificialntelligence_presentation.pptx
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
“AI and Expert System Decision Support & Business Intelligence Systems”
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Assigned Numbers - 2025 - Bluetooth® Document

Python Introduction