Skip to content

Guided Lab Template

Module: Replace with module number and topic.

Use this lab when students need a structured path through a practical Python task.

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

Scenario

A campus help desk wants a quick way to review support tickets. The program should count tickets, identify whether the workload is high, and display a short status message.

This scenario is intentionally small so you can focus on the Python steps.

Step-by-Step Tasks

Complete the lab in order:

  1. Store the number of tickets from each day.
  2. Put the ticket counts into a list.
  3. Use a loop to calculate the total.
  4. Use a condition to decide whether the workload is high.
  5. Print a clear summary.

Run each cell before moving to the next one.

Step 1: Store Daily Ticket Counts

Start with a few simple values. These numbers are small so the output is easy to check by hand.

# TODO: Change these numbers to create a new test case.
monday_tickets = 4
tuesday_tickets = 6
wednesday_tickets = 3

print("Monday:", monday_tickets)
print("Tuesday:", tuesday_tickets)
print("Wednesday:", wednesday_tickets)

Step 2: Store the Values in a List

A list keeps related values together. This makes it easier to process each value with a loop.

# TODO: Add the three ticket variables to this list.
ticket_counts = [monday_tickets, tuesday_tickets, wednesday_tickets]

print(ticket_counts)

Step 3: Process the Data

Use a loop to add each ticket count to the total. Read the loop out loud if it helps: for each count in the list, add it to the total.

total_tickets = 0

# TODO: Complete the loop by adding each count to total_tickets.
for count in ticket_counts:
    total_tickets = total_tickets + count

print("Total tickets:", total_tickets)

Step 4: Make a Decision

The help desk wants to know when the workload is high. Use an if statement to choose a message.

high_workload_limit = 12

# TODO: Change the message text if you want it to be clearer.
if total_tickets > high_workload_limit:
    status_message = "High workload"
else:
    status_message = "Workload is manageable"

print(status_message)

Step 5: Display the Final Output

A useful program prints results in a way another person can understand.

# TODO: Add one more print line that gives advice to the help desk.
print("Help Desk Ticket Summary")
print("Ticket counts:", ticket_counts)
print("Total tickets:", total_tickets)
print("Status:", status_message)

Hints

Use these only if you get stuck:

  1. If a variable is not found, rerun earlier cells in order.
  2. If the total is wrong, print the list and check the numbers.
  3. If the status seems wrong, check the comparison operator and the limit value.
  4. If indentation looks uneven, line up the code inside the if or loop.

Output Check

Your final output should clearly show:

  1. the ticket counts list
  2. the total number of tickets
  3. a status message such as High workload or Workload is manageable

The exact numbers may be different if you changed the starter values.

Reflection

Answer in 2-4 sentences:

  1. What did this program calculate or decide?
  2. What was one part that was difficult?
  3. What did you test or change to make the program work?