🎓 EASYTUTORGUIDE · Complete Python Course

Very beginner → professional Python · 60 chapters · 900 topics

EasyTutorGuide

Chapter 11: Conditional Statements

Complete Python lesson for very beginners. Technical words are explained in simple language, and every outline topic includes a practical example, expected output, steps, and practice.

Python CourseVery Beginner Friendly15 TopicsExamples + Output20 Q&A
Chapter 11 · 15 topics
100%

Chapter Overview

This Python tutorial chapter covers Conditional Statements through 15 connected topics. Work through the examples in order, check the expected output, and complete the practice after each topic.

  • 11.1 Boolean Expressions
  • 11.2 if
  • 11.3 else
  • 11.4 elif
  • 11.5 Multiple Conditions
  • Plus 10 additional Python topics in this chapter.

11.1 Boolean Expressions

Boolean Expressions is part of Conditional Statements. In simple language, it means a True or False value.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Boolean Expressions (a True or False value).

Python / Practical Example

score = 82
if score >= 70:
    print("pass")

Expected Output

pass

Step-by-Step Explanation

  1. Create a condition.
  2. if runs its block only when the condition is truthy.
  3. Indent the controlled statement.
Practice: Re-type the example for “Boolean Expressions”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.2 if

if is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: if (a Python idea used while learning conditional statements).

Python / Practical Example

score = 82
if score >= 70:
    print("pass")

Expected Output

pass

Step-by-Step Explanation

  1. Create a condition.
  2. if runs its block only when the condition is truthy.
  3. Indent the controlled statement.
Practice: Re-type the example for “if”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.3 else

else is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: else (a Python idea used while learning conditional statements).

Python / Practical Example

age = 15
if age >= 18:
    print("adult")
else:
    print("minor")

Expected Output

minor

Step-by-Step Explanation

  1. Test a condition.
  2. The condition is false.
  3. else runs the alternative block.
Practice: Re-type the example for “else”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.4 elif

elif is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: elif (a Python idea used while learning conditional statements).

Python / Practical Example

score = 75
if score >= 90:
    grade = "A"
elif score >= 70:
    grade = "B"
else:
    grade = "C"
print(grade)

Expected Output

B

Step-by-Step Explanation

  1. Check the first condition.
  2. elif checks another condition when earlier ones fail.
  3. Only one branch in this chain runs.
Practice: Re-type the example for “elif”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.5 Multiple Conditions

Multiple Conditions is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Multiple Conditions (a Python idea used while learning conditional statements).

Python / Practical Example

value = 5
print("positive" if value > 0 else "not positive")

Expected Output

positive

Step-by-Step Explanation

  1. Read the example from top to bottom.
  2. Identify the value, object, or operation related to this topic.
  3. Change one small input and predict the result before running it.
Practice: Re-type the example for “Multiple Conditions”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.6 Nested Conditions

Nested Conditions is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Nested Conditions (a Python idea used while learning conditional statements).

Python / Practical Example

value = 5
print("positive" if value > 0 else "not positive")

Expected Output

positive

Step-by-Step Explanation

  1. Read the example from top to bottom.
  2. Identify the value, object, or operation related to this topic.
  3. Change one small input and predict the result before running it.
Practice: Re-type the example for “Nested Conditions”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.7 and

and is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: and (a Python idea used while learning conditional statements).

Python / Practical Example

age = 20
has_id = True
print(age >= 18 and has_id)
print(not has_id)

Expected Output

True
False

Step-by-Step Explanation

  1. Build boolean conditions.
  2. and requires both conditions to be true.
  3. not reverses a boolean value.
Practice: Re-type the example for “and”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.8 or

or is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: or (a Python idea used while learning conditional statements).

Python / Practical Example

age = 20
has_id = True
print(age >= 18 and has_id)
print(not has_id)

Expected Output

True
False

Step-by-Step Explanation

  1. Build boolean conditions.
  2. and requires both conditions to be true.
  3. not reverses a boolean value.
Practice: Re-type the example for “or”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.9 not

not is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: not (a Python idea used while learning conditional statements).

Python / Practical Example

age = 20
has_id = True
print(age >= 18 and has_id)
print(not has_id)

Expected Output

True
False

Step-by-Step Explanation

  1. Build boolean conditions.
  2. and requires both conditions to be true.
  3. not reverses a boolean value.
Practice: Re-type the example for “not”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.10 Truthy Values

Truthy Values is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Truthy Values (a Python idea used while learning conditional statements).

Python / Practical Example

values = [0, 1, "", "hello"]
for value in values:
    print(bool(value))

Expected Output

False
True
False
True

Step-by-Step Explanation

  1. bool() shows truthiness.
  2. Zero and an empty string are falsy.
  3. Nonzero numbers and nonempty strings are truthy.
Practice: Re-type the example for “Truthy Values”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.11 Falsy Values

Falsy Values is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Falsy Values (a Python idea used while learning conditional statements).

Python / Practical Example

values = [0, 1, "", "hello"]
for value in values:
    print(bool(value))

Expected Output

False
True
False
True

Step-by-Step Explanation

  1. bool() shows truthiness.
  2. Zero and an empty string are falsy.
  3. Nonzero numbers and nonempty strings are truthy.
Practice: Re-type the example for “Falsy Values”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.12 Conditional Expressions

Conditional Expressions is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Conditional Expressions (a Python idea used while learning conditional statements).

Python / Practical Example

score = 82
if score >= 70:
    print("pass")

Expected Output

pass

Step-by-Step Explanation

  1. Create a condition.
  2. if runs its block only when the condition is truthy.
  3. Indent the controlled statement.
Practice: Re-type the example for “Conditional Expressions”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.13 Guard Conditions

Guard Conditions is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Guard Conditions (a Python idea used while learning conditional statements).

Python / Practical Example

value = 5
print("positive" if value > 0 else "not positive")

Expected Output

positive

Step-by-Step Explanation

  1. Read the example from top to bottom.
  2. Identify the value, object, or operation related to this topic.
  3. Change one small input and predict the result before running it.
Practice: Re-type the example for “Guard Conditions”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.14 Common Mistakes

Common Mistakes is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Common Mistakes (a Python idea used while learning conditional statements).

Python / Practical Example

value = 5
print("positive" if value > 0 else "not positive")

Expected Output

positive

Step-by-Step Explanation

  1. Read the example from top to bottom.
  2. Identify the value, object, or operation related to this topic.
  3. Change one small input and predict the result before running it.
Practice: Re-type the example for “Common Mistakes”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

11.15 Decision-Making Projects

Decision-Making Projects is part of Conditional Statements. In simple language, it means a Python idea used while learning conditional statements.

It is one building block of conditional statements and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.

Technical words in simple language: Decision-Making Projects (a Python idea used while learning conditional statements).

Python / Practical Example

value = 5
print("positive" if value > 0 else "not positive")

Expected Output

positive

Step-by-Step Explanation

  1. Read the example from top to bottom.
  2. Identify the value, object, or operation related to this topic.
  3. Change one small input and predict the result before running it.
Practice: Re-type the example for “Decision-Making Projects”, change one safe input, predict the result before running it, and explain in one sentence why the result changed.

Common Beginner Mistakes

  • Copying code without predicting what each line does.
  • Ignoring the first useful error message or traceback location.
  • Mixing tabs/spaces or changing indentation accidentally.
  • Using data of the wrong type for an operation.
  • Trying to learn many advanced variations before mastering one small working example.

Chapter Practice

  1. Choose three topics from this chapter and re-type their examples without copying and pasting.
  2. For each example, change one input and predict the output first.
  3. Explain five technical terms from this chapter in your own beginner-friendly words.
  4. Create one small program that combines at least two chapter topics.
  5. Keep notes about errors you made and what fixed them.

Mini Project / Challenge

Create a small Python exercise that combines at least three ideas from Conditional Statements. Start with a tiny working version, test it, then improve it one step at a time.

  1. Choose three topics from this chapter.
  2. Write or adapt a small Python example using those topics.
  3. Predict the output before running the code.
  4. Test at least one different input.
  5. Write two sentences explaining what the program does and what you learned.

20 Questions & Answers

1. What is the main goal of Chapter 11?

The goal is to understand conditional statements through small explanations, examples, and practice.

2. Should I memorize every command or method?

No. Understand the pattern, practice the common form, and learn how to read documentation when you need exact details.

3. Why are the examples small?

Small examples isolate one idea at a time, which makes errors easier to understand and fix.

4. What should I do when an example gives an error?

Read the last part of the traceback, check spelling and indentation, confirm the required package or file exists, and compare the input types with what the operation expects.

5. Why should I predict output before running code?

Prediction forces you to reason about the program instead of only copying it.

6. What should I remember about Boolean Expressions?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

7. What should I remember about if?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

8. What should I remember about else?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

9. What should I remember about elif?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

10. What should I remember about Multiple Conditions?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

11. What should I remember about Nested Conditions?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

12. What should I remember about and?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

13. What should I remember about or?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

14. What should I remember about not?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

15. What should I remember about Truthy Values?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

16. What should I remember about Falsy Values?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

17. What should I remember about Conditional Expressions?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

18. What should I remember about Guard Conditions?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

19. What should I remember about Common Mistakes?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.

20. What should I remember about Decision-Making Projects?

Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.