Download presentation
Presentation is loading. Please wait.
Published byCalvin Jenkins Modified over 9 years ago
1
Python – Making Decisions Lecture 02
2
Control Structures A program that only has one flow is useful but limited. We can use if statements to make these decisions
3
If - Syntax if (condition): indented code block
4
Comparison Operators Equal to Greater than Less than Greater than or equal to Less than or equal to Not equal to == > < >= <= !=
5
Else- Syntax What if you want something to happen when the if condition is false?
6
If Else - Example
7
Checking for Multiple Conditions We use an elif statement to check multiple conditions.
8
Elif - Example
9
Logic Operators Check for multiple conditions in the same keyword. There are only three: and, or, not.
10
Precedence
11
You asleep yet?
12
Logic Example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.