SlideShare a Scribd company logo
Python Workshop
THOMAS FRANTZ
Install Python
https://www.python.org/downloads/
Hello World
print("Hello World!")
Hello World
print("Hello World!")
Hello World
print("Hello World!")
Hello World
print("Hello World!")
Input & Output
name = input("What's your name? ")
print("Hello" + name + "!")
Input & Output
name = input("What's your name? ")
print("Hello" + name + "!")
Input & Output
name = input("What's your name? ")
print("Hello" + name + "!")
Input & Output
name = input("What's your name? ")
print("Hello" + name + "!")
Variables & Data Types
name = "Tom"
age = 21
graduated = True
has_2_sisters = False
uni_courses = None
Variables & Data Types
name = "Tom"
age = 21
graduated = True
has_2_sisters = False
uni_courses = None
Variables & Data Types
name = "Tom"
age = 21
graduated = True
has_2_sisters = False
uni_courses = None
Operators & Maths
1 == 1
1 != 2
2 > 1
1 < 2
1 >= 1
1 <= 478942318946531
Operators & Maths
1 + 2 = 3
2 - 1 = 1
2 * 3 = 6
4 / 3 = 1.3333...
2 ** 3 = 8 (2^3)
Operators & Maths
and (True and True)
or (False or True)
is (True is True)
not (not False)
Control Flow
if condition:
code
name = "Tom"
if name == "Tom":
print("Hello Tom!")
Control Flow
if condition:
code
name = "Tom"
if name == "Tom":
print("Hello Tom!")
Control Flow
if condition:
code
name = "Tom"
if name == "Tom":
print("Hello Tom!")
Control Flow
if condition:
code
name = "Tom"
if name == "Tom":
print("Hello Tom!")
Control Flow
if condition:
code
name = "Tom"
if name == "Tom":
print("Hello Tom!")
Indentation
if condition:
....code
name = "Tom"
if name == "Tom":
....print("Hello Tom!")
Control Flow
if condition:
code
elif condition:
code
else:
code
if name == "Tom":
print("Hi Tom")
elif name == "Mili":
print("Hi Mili!!!")
else:
print("Hi Stranger")
Control Flow
if condition:
code
elif condition:
code
else:
code
if name == "Tom":
print("Hi Tom")
elif name == "Mili":
print("Hi Mili!!!")
else:
print("Hi Stranger")
Lists
pizza = "Leonardo's Meat Lovers Pizza"
fave_foods = ["salmon", "prawn pasta", pizza]
prawns = fave_foods[1]
Lists
pizza = "Leonardo's Meat Lovers Pizza"
fave_foods = ["salmon", "prawn pasta", pizza]
prawns = fave_foods[1]
Lists
pizza = "Leonardo's Meat Lovers Pizza"
fave_foods = ["salmon", "prawn pasta", pizza]
prawns = fave_foods[1]
Lists
pizza = "Leonardo's Meat Lovers Pizza"
fave_foods = ["salmon", "prawn pasta", pizza]
prawns = fave_foods[1]
Loops
while condition:
code
print("This is a dream ...")
while True:
print("... inside a dream ...")
Loops
for item in iterator:
code
for food in ["pizza", "pasta", "garlic bread"]:
print(f"I love {food}")
Loops
for item in iterator:
break
for food in ["pizza", "grass", "garlic bread"]:
if food == "grass":
print(f"Yuck! I hate {food}")
break
print(f"I love {food}")
Dictionaries
my_name = "Tom"
me = {
"name": my_name,
"age": 21,
"siblings": 1
}
print(f"age: {me['age']}")
Dictionaries
my_name = "Tom"
me = {
"name": my_name,
"age": 21,
"siblings": 1
}
print(f"age: {me['age']}")
Dictionaries
my_name = "Tom"
me = {
"name": my_name,
"age": 21,
"siblings": 1
}
print(f"age: {me['age']}")
Dictionaries
my_name = "Tom"
me = {
"name": my_name,
"age": 21,
"siblings": 1
}
print(f"age: {me['age']}")
Dictionaries
my_name = "Tom"
me = {
"name": my_name,
"age": 21,
"siblings": 1
}
print(f"age: {me['age']}")
Functions
def function_name(param, param2):
code
return value
Functions
def function_name(param, param2):
code
return value
Functions
def function_name(param, param2):
code
return value
Functions
def function_name(param, param2):
code
return value
Functions
def function_name(param, param2):
code
return value
Functions
def function_name(param, param2):
pass
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
instance = ClassName("Hello World!")
hello = instance.hello()
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
instance = ClassName("Hello World!")
hello = instance.hello()
Classes
class ClassName:
def __init__(self, con_argument):
self.var_name = con_argument
def hello(self):
print(self.var_name)
return self.var_name
instance = ClassName("Hello World!")
hello = instance.hello()
September Theme
Futuristic Month!
Questions about the workshop?!
What's your fave language?
Python Workshop by Tom Frantz

More Related Content

PDF
How to start using types in Python with mypy
PDF
TDDBC お題
PDF
Girl Geek Dinners - Clojure 101
PDF
Fizz and buzz of computer programs in python.
PPT
Python легко и просто. Красиво решаем повседневные задачи
PDF
#safaDojo - Coding Dojo Go lang
PDF
Async: ways to store state
PDF
A toolbelt of seasoned bug hunter - Damir Zekic
How to start using types in Python with mypy
TDDBC お題
Girl Geek Dinners - Clojure 101
Fizz and buzz of computer programs in python.
Python легко и просто. Красиво решаем повседневные задачи
#safaDojo - Coding Dojo Go lang
Async: ways to store state
A toolbelt of seasoned bug hunter - Damir Zekic

What's hot (20)

PDF
C: A Humbling Language
PPTX
Unix study class_01
PPTX
The groovy puzzlers (as Presented at JavaOne 2014)
KEY
Use cases in the code with AOP
PDF
R で解く FizzBuzz 問題
PDF
Workshop programs
PDF
Yapc Asia 2008 TMTOWTMS
PDF
النشرة الداخلية لشراب ريافللين
PDF
Defer, Panic, Recover
PDF
Comunicação Bluetooth Entre Python e PyS60
PPTX
Session 02 python basics
PDF
Migrate to Python 3 using the six library
PDF
10 reasons to love CoffeeScript
PDF
Vim Hacks
PPTX
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
PPTX
Awesomely descriptive JavaScript with monads
PDF
PFDS 8.4.1
PPTX
Scripting 101
PDF
My Robot Poops - In JavaScript (with web sockets)
PPTX
Hsv.py Lightning Talk - Bottle
C: A Humbling Language
Unix study class_01
The groovy puzzlers (as Presented at JavaOne 2014)
Use cases in the code with AOP
R で解く FizzBuzz 問題
Workshop programs
Yapc Asia 2008 TMTOWTMS
النشرة الداخلية لشراب ريافللين
Defer, Panic, Recover
Comunicação Bluetooth Entre Python e PyS60
Session 02 python basics
Migrate to Python 3 using the six library
10 reasons to love CoffeeScript
Vim Hacks
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
Awesomely descriptive JavaScript with monads
PFDS 8.4.1
Scripting 101
My Robot Poops - In JavaScript (with web sockets)
Hsv.py Lightning Talk - Bottle
Ad

Similar to Python Workshop by Tom Frantz (20)

PDF
Python introduction 1
ODP
PDF
Python tutorial
PDF
Raspberry Pi - Lecture 5 Python for Raspberry Pi
PPT
Python tutorialfeb152012
PDF
GE3151_PSPP_UNIT_3_Notes
PPT
PDF
Python Usage (5-minute-summary)
PPTX
python introductions2 to basics programmin.pptx
DOCX
Python Laboratory Programming Manual.docx
PDF
Python Part 1
PDF
intro_to_python_20150825
PDF
AmI 2017 - Python basics
PDF
xii cs practicals
PPTX
Python.pptx
PPTX
Chapter 9 Conditional and Iterative Statements.pptx
PDF
Python! An Introduction
PDF
xii cs practicals class 12 computer science.pdf
PPTX
File handling in pythan.pptx
PDF
Python_Cheat_Sheet_Keywords_1664634397.pdf
Python introduction 1
Python tutorial
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Python tutorialfeb152012
GE3151_PSPP_UNIT_3_Notes
Python Usage (5-minute-summary)
python introductions2 to basics programmin.pptx
Python Laboratory Programming Manual.docx
Python Part 1
intro_to_python_20150825
AmI 2017 - Python basics
xii cs practicals
Python.pptx
Chapter 9 Conditional and Iterative Statements.pptx
Python! An Introduction
xii cs practicals class 12 computer science.pdf
File handling in pythan.pptx
Python_Cheat_Sheet_Keywords_1664634397.pdf
Ad

More from Prottay Karim (14)

PDF
The Interview Workshop Series : Acing the Behavioural Interview
PDF
Automated Testing: QA Horizons
PDF
Journey To Open Source
PDF
Design Day Workshop
PDF
Hackvision Closing Ceremony
PDF
Presentation Workshop - Hackvision
PDF
Ideation & Agile Workshop - Hackvision
PDF
UI/UX Workshop - Hackvision
PDF
Hackvision Opening Ceremony
PDF
Intro to Machine Learning with TF- workshop
PDF
Personal Branding with Gwenny Warnick
PDF
ROAR - Diversity in Tech
PDF
What’s next with RedBackBots?!
PPTX
Cloud Study Jam Exploring the Cloud
The Interview Workshop Series : Acing the Behavioural Interview
Automated Testing: QA Horizons
Journey To Open Source
Design Day Workshop
Hackvision Closing Ceremony
Presentation Workshop - Hackvision
Ideation & Agile Workshop - Hackvision
UI/UX Workshop - Hackvision
Hackvision Opening Ceremony
Intro to Machine Learning with TF- workshop
Personal Branding with Gwenny Warnick
ROAR - Diversity in Tech
What’s next with RedBackBots?!
Cloud Study Jam Exploring the Cloud

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Python Workshop by Tom Frantz