Skip to content

Notebook Title

Module: Replace with module number and topic.

Use this short description to explain what students will practice in this notebook and why it matters for everyday Python or IT work.

Run in Binder Open in Colab Download notebook

Read here. Practice in a notebook.

This page shows the original notebook. Open Binder or Colab to run and edit cells. Work one cell at a time: some examples are deliberately broken for debugging practice. Download your work before leaving Binder; its sessions are temporary.

View original source

Learning Objectives

By the end of this notebook, you should be able to:

  1. Describe the main Python idea in plain language.
  2. Run and edit a small Python example.
  3. Use the idea in a guided practice task.
  4. Check your work by reading output and fixing simple errors.

Concept Overview

Write a short explanation of the new idea here. Keep it practical and concrete.

A helpful pattern:

  1. What is the idea?
  2. When would someone use it?
  3. What should students notice in the example below?

Example

Run this example first. Then read the output and connect it to the explanation above.

# Example: check whether a score meets a simple goal
student_name = "Ava"
score = 88
passing_score = 70

if score >= passing_score:
    result = "passing"
else:
    result = "not passing yet"

print(student_name, "is", result)

What the Example Does

This example stores values in variables, compares two numbers, and prints a message based on the result.

Guided Practice

Complete each TODO one step at a time. Run the cell after each small change.

Hints:

  1. Use clear variable names.
  2. Check spelling carefully.
  3. Compare your output to the task before moving on.
# TODO 1: Change the name and score values.
# TODO 2: Change the goal value.
# TODO 3: Run the cell and explain the output in your own words.

student_name = "Your name"
score = 75
goal = 80

if score >= goal:
    message = "met the goal"
else:
    message = "did not meet the goal yet"

print(student_name, message)

Independent Practice

Now try a similar task with a small change. Choose a simple real-world example, such as checking a budget, login attempts, or task completion.

Your task:

  1. Create at least two variables.
  2. Use one comparison.
  3. Print a clear result message.
# Independent practice starter
# TODO: Replace these values with your own simple example.

item = "Notebook"
amount = 4.50
limit = 10.00

# TODO: Write an if statement that checks whether amount is within the limit.

# TODO: Print a clear message that includes the item name.

Common Errors

Mistake 1: Different variable spelling

score = 88
print(scroe)

Why it happens: Python treats score and scroe as different names. Check spelling carefully.

Mistake 2: Missing colon after if

if score >= 70
    print("passing")

Why it happens: Python needs a colon at the end of an if line.

Checkpoint

Answer this before moving on:

What value is being compared in your practice code, and what decision does the program make?

# Checkpoint response
# TODO: Write one sentence as a string and print it.

checkpoint_answer = "My program compares ..."
print(checkpoint_answer)

Reflection

In 2-3 sentences, answer:

  1. What did you learn from this notebook?
  2. What was one part you had to test or fix?
  3. How could this idea be useful in school, work, or daily life?