Skip to content

12 Guided Mini Project

This notebook guides you through a small Python project one step at a time.

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, you should be able to:

  • Combine input, lists, loops, calculations, and decisions.
  • Build a small program from a clear plan.
  • Test your program with expected results.
  • Explain one error you fixed.

Project Overview

Your mini project will collect small pieces of information, process them, and print a useful result. Keep it simple and focus on showing the course skills clearly.

Program Workflow

This is the structure you will follow when building your program:

  1. Get Input
  2. Store Data
  3. Process Data
  4. Make Decisions
  5. Display Results

Guided Example

This example reviews three login attempt counts and decides whether the average needs attention. Watch how each step matches the workflow.

Think Before You Run

If the average login attempts is greater than 3, what message should the program print?

# Instructor-Guided Example: login attempt review

# Step 1: Input
user_name = input("Enter user name: ")

# Step 2: Collect and store data
day_1 = int(input("Enter login attempts for day 1: "))
day_2 = int(input("Enter login attempts for day 2: "))
day_3 = int(input("Enter login attempts for day 3: "))
attempts = [day_1, day_2, day_3]

# Step 3: Process the list with a loop
total_attempts = 0
for attempt in attempts:
    total_attempts = total_attempts + attempt

# Step 4: Calculate a result
average_attempts = total_attempts / len(attempts)

# Step 5: Decision
if average_attempts > 3:
    status = "needs review"
else:
    status = "looks okay"

# Step 6: Output
print("User:", user_name)
print("Attempts:", attempts)
print("Average attempts:", average_attempts)
print("Status:", status)

Student Template

You do not need to start from scratch. Follow the steps and build your program one part at a time.

# Student Template

# Step 1: Get input
project_name = input("Enter a name for this project: ")

# Step 2: Collect and store data
value_1 = float(input("Enter number 1: "))
value_2 = float(input("Enter number 2: "))
value_3 = float(input("Enter number 3: "))
values = [value_1, value_2, value_3]

# Step 3: Process the list with a loop
total = 0
for value in values:
    total = total + value

# Step 4: Make a decision
average = total / len(values)

# TODO: Change the threshold for your project.
threshold = 10
if average > threshold:
    message = "above the threshold"
else:
    message = "at or below the threshold"

# Step 5: Display result
print("Project:", project_name)
print("Values:", values)
print("Total:", total)
print("Average:", average)
print("Result:", message)

Project Options

Choose one idea or create a similar one:

  • Grade Analyzer: calculate an average and decide pass/fail.
  • Expense Tracker: total expenses and show a warning if spending is high.
  • Login Monitor: track attempts and show alerts for high activity.
  • Disk Usage Monitor: collect disk readings and flag high usage.

Requirements Checklist

Your project should include:

  • At least one input().
  • Clearly named variables.
  • A list that stores data.
  • A loop that collects or processes data.
  • A calculation such as total or average.
  • A conditional such as if-else.
  • Clear printed output.
  • A normal-case and edge-case test.
  • A completed Fix Log and reflection.

Debugging (Fix Log)

Fix Log: this section is required. Complete it after you test your project:

  • What error or unexpected result did you encounter? If your program worked as expected, describe one change or test you made.
  • What caused the error or unexpected result, if applicable?
  • What did you change or test, and what did you learn?

AI Verification Task

If you use AI, ask it to explain your code one section at a time. Then check whether the explanation matches what your code actually does.

You should be able to explain the input, list, loop, calculation, conditional, and output in your own words.

Validation and Testing

Test your program with different inputs to check if it works correctly. Try a normal case and an edge case.

# Validation example
# Normal case: if the values are 2, 4, and 6, the total should be 12 and the average should be 4.

test_values = [2, 4, 6]
test_total = sum(test_values)
test_average = test_total / len(test_values)

print("Expected total: 12")
print("Actual total:", test_total)
print("Expected average: 4")
print("Actual average:", test_average)

# Edge case: all values are 0, so the total and average should be 0.
edge_values = [0, 0, 0]
edge_total = sum(edge_values)
edge_average = edge_total / len(edge_values)
print("Edge case total:", edge_total)
print("Edge case average:", edge_average)

Common Mistakes

Common mistakes are normal. Fix one issue at a time.

Watch for:

  • Forgetting to convert input with int() or float().
  • Forgetting to add values to the list.
  • Dividing by the wrong number.
  • Printing unclear output.
  • Changing too many things before testing again.

Reflection Questions

  • What does your program help someone decide or understand?
  • Which part of the workflow was easiest for you?
  • Which part did you need to test or fix?
  • How could this project idea be used in a real setting?

Wrap-Up

You have built a complete program. You applied core concepts from the course, including input, variables, lists, loops, decisions, output, debugging, and validation.

You can now begin building your own simple applications using Python.

Submission Checklist

Before submitting, confirm:

  • Your notebook runs from top to bottom.
  • Your project includes all required features.
  • Your output is easy to read.
  • Your Fix Log is complete.
  • Your validation test is included.
  • You can explain your code in your own words.