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.
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:
- Store the number of tickets from each day.
- Put the ticket counts into a list.
- Use a loop to calculate the total.
- Use a condition to decide whether the workload is high.
- 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:
- If a variable is not found, rerun earlier cells in order.
- If the total is wrong, print the list and check the numbers.
- If the status seems wrong, check the comparison operator and the limit value.
- If indentation looks uneven, line up the code inside the
ifor loop.
Output Check¶
Your final output should clearly show:
- the ticket counts list
- the total number of tickets
- a status message such as
High workloadorWorkload is manageable
The exact numbers may be different if you changed the starter values.
Reflection¶
Answer in 2-4 sentences:
- What did this program calculate or decide?
- What was one part that was difficult?
- What did you test or change to make the program work?