
Python Conditionals
Presentation
•
Computers
•
7th - 12th Grade
•
Practice Problem
•
Medium
Jason Davis
Used 64+ 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 Blank
Type answer...
12
Fill in the Blank
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
9 questions
El verbo tener-To have-in present tense
Presentation
•
8th - 12th Grade
13 questions
Argumentative Conclusions
Presentation
•
7th - 12th Grade
11 questions
Programación. conceptos básicos
Presentation
•
7th - 12th Grade
13 questions
Musical Form CBA
Presentation
•
7th - 12th Grade
9 questions
Python Selection Statement
Presentation
•
7th - 12th Grade
11 questions
REAL OR FAKE
Presentation
•
6th - 12th Grade
11 questions
Pythagorean Theorem
Presentation
•
8th - 12th Grade
9 questions
Informatika
Presentation
•
7th - 12th Grade
Popular Resources on Wayground
10 questions
5.P.1.3 Distance/Time Graphs
Quiz
•
5th Grade
10 questions
Fire Drill
Quiz
•
2nd - 5th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
22 questions
School Wide Vocab Group 1 Master
Quiz
•
6th - 8th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade