Py

Making Decisions

Module 4 of 14, Beginner
🔀

Making Decisions

Booleans, comparisons, if / elif / else and logical operators.

0 of 5 lessons complete

5 lessons, 46 min

Start module

Lessons

1

True, False and comparisons

Ask yes/no questions about values with comparison operators.

8 min
2

if and else

Run code only when a condition is true, and choose between two paths.

10 min
3

elif: more than two choices

Chain several conditions with elif; the first true one wins.

9 min
4

and, or, not

Combine conditions with logical operators.

9 min
5

Truthy values and nested ifs

Use any value as a condition, nest decisions and write one-line if expressions.

10 min
🔁
Next module

Loops