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

Similar to Python Workshop by Tom Frantz (6)

PDF
AmI 2016 - Python basics
PDF
Practical File Grade 12.pdf
PDF
Python
PDF
PDF
اسلاید دوم جلسه چهارم کلاس پایتون برای هکرهای قانونی
PDF
Python Basic
AmI 2016 - Python basics
Practical File Grade 12.pdf
Python
اسلاید دوم جلسه چهارم کلاس پایتون برای هکرهای قانونی
Python Basic

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)

PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
Information-Technology-in-Human-Society (2).pptx
PDF
Optimizing bioinformatics applications: a novel approach with human protein d...
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
PPTX
Blending method and technology for hydrogen.pptx
PDF
Peak of Data & AI Encore: Scalable Design & Infrastructure
PDF
Examining Bias in AI Generated News Content.pdf
PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PPTX
CRM(Customer Relationship Managmnet) Presentation
PPTX
Information-Technology-in-Human-Society.pptx
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
Addressing the challenges of harmonizing law and artificial intelligence tech...
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
Ebook - The Future of AI A Comprehensive Guide.pdf
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Information-Technology-in-Human-Society (2).pptx
Optimizing bioinformatics applications: a novel approach with human protein d...
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Domain-specific knowledge and context in large language models: challenges, c...
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
Blending method and technology for hydrogen.pptx
Peak of Data & AI Encore: Scalable Design & Infrastructure
Examining Bias in AI Generated News Content.pdf
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
CRM(Customer Relationship Managmnet) Presentation
Information-Technology-in-Human-Society.pptx

Python Workshop by Tom Frantz