
Python Conditionals
Presentation
•
Computers
•
7th - 12th Grade
•
Practice Problem
•
Medium
Jason Davis
Used 65+ times
FREE Resource
8 Slides • 8 Questions
1
Python Conditionals
by Jason Davis
2
What's Up?
Essential Question
How can a program make decisions about whether or not to run code?
Objective
I can write code that decides whether or not to perform an action
3
Define: conditional
Code structure
Lets us make decisions
Do a section of code or skip it
"If yes, then do something"
Example: "If it is raining, then I'll bring an umbrella."
4
Multiple Choice
What best describes a conditional?
I will do what I want
If the answer is no, then I'll do something
If it doesn't snow I'll wear my snow boots to school
If the answer is yes, then I'll do something
5
Define: if-clause/then-block
if-clause in code is the condition:
if-clause decides whether or not to proceed with the then-block
then-block has at least one line of code
then-block can either be executed or skipped depending on the if-clause
6
Multiple Choice
Which part of a conditional decides whether or not to skip the then-block?
if-clause
then-block
input statement
print statement
7
Structure of a Conditional
Two parts: if-clause and then-block
then-block is indented under if-clause
Words go in quote marks, numbers don't
Don't forget the colon!
8
Multiple Choice
What happens to the then-block if the condition in the if statement isn't true?
It runs either way
It gets skipped
You will receive an error message
The program asks the user the input a new answer
9
Multiple Choice
What happens to the then-block you forget the colon after the if-clause
It runs either way
It gets skipped
You will receive an error message
The program asks the user the input a new answer
10
Define: comparison operators
Comparison Operators are the symbols that help determine if a conditional is true or false. You might recognize them from your math class - but with a twist!
< less than
<= less than or equal to
> greater than
>= greater than or equal to
== equal to
!= not equal to
11
Fill in the Blanks
Type answer...
12
Fill in the Blanks
Type answer...
13
What is a valid condition?
Part of the if-clause
Asks a yes or no question
Usually contains an expression (a comparison of value)
Often uses comparison operators
14
Multiple Choice
True or false: The if-clause HAS to use numbers for comparison.
True
False
15
I'm just using this slide so there aren't two questions in a row. It's good, right?
​
16
Poll
On a scale of 1-5, where are you on conditionals?
1
Conditionals? Never heard of them.
2
I am strugling to understand the vocabulary and the coding.
3
I understand the vocabulary, but I'm struggling with the coding.
4
I am good with the coding, but still fuzzy on the vocab
5
I understand everything and I can code programs with conditionals by myself.
Python Conditionals
by Jason Davis
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
13 questions
The Electoral College
Presentation
•
6th - 12th Grade
12 questions
Anne Frank Character Change
Presentation
•
6th - 9th Grade
13 questions
Independent vs Dependent Variables
Presentation
•
7th - 12th Grade
11 questions
Reading News Online
Presentation
•
5th Grade
11 questions
Identify Essential Study Skills
Presentation
•
6th - 12th Grade
12 questions
Description in Writing
Presentation
•
8th - 12th Grade
12 questions
Cos'è LINUX ?
Presentation
•
6th - 12th Grade
13 questions
Persuasive Appeals
Presentation
•
7th - 11th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade