Project 1: Data Explorer
Overview
In this project, you'll build a program that analyzes a dataset and presents interesting findings. You'll practice using variables, conditionals, and loops to process real data and generate a summary report.
This is your first multi-part project—take it step by step, and don't hesitate to ask for help!
Learning Objectives
This project assesses your ability to:
- Store and manipulate data using variables (Outcome 1: Variables & Data Types)
- Use conditionals to make decisions based on data (Outcome 2: Control Flow)
- Use loops to process multiple data items (Outcome 3: Iteration)
- Break down a problem into smaller steps (Outcome 6: Problem Solving)
The Dataset
You'll work with weather data for a city over 7 days. The data is provided as a list of daily high temperatures (in Fahrenheit):
# Weather data: daily high temperatures for one week
temperatures = [72, 68, 75, 80, 77, 71, 69]
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
Copy this data into your program to get started.
Requirements
Functional Requirements
Your program must:
- Calculate the average temperature for the week
- Find the highest and lowest temperatures and which days they occurred
- Count how many days were above 75°F (hot days) and below 70°F (cool days)
- Classify each day as "Hot" (>75), "Mild" (70-75), or "Cool" (<70)
- Print a formatted report showing all findings
Output Format
Your program should produce output similar to this:
=== Weekly Weather Report ===
Daily Breakdown:
Monday: 72°F (Mild)
Tuesday: 68°F (Cool)
Wednesday: 75°F (Mild)
Thursday: 80°F (Hot)
Friday: 77°F (Hot)
Saturday: 71°F (Mild)
Sunday: 69°F (Cool)
Summary:
- Average temperature: 73.1°F
- Highest: 80°F on Thursday
- Lowest: 68°F on Tuesday
- Hot days (>75°F): 2
- Cool days (<70°F): 2
Technical Requirements
Your code must:
- Use a loop to process the temperature data (no copying/pasting 7 if-statements!)
- Use meaningful variable names
- Include comments explaining your approach
- Run without errors
Getting Started
Step-by-Step Approach
Don't try to do everything at once! Here's a suggested order:
- Start simple: Just print each day and temperature
- Add classification: Add the Hot/Mild/Cool label to each day
- Calculate average: Sum all temperatures, divide by count
- Find extremes: Track the highest and lowest as you loop
- Count categories: Count hot and cool days
- Format output: Make it look nice
Starter Code
# Weather data
temperatures = [72, 68, 75, 80, 77, 71, 69]
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
# TODO: Your code here!
# Hint: You can loop through both lists at once using index
for i in range(len(days)):
day = days[i]
temp = temperatures[i]
print(day, temp)
Helpful Techniques
Calculating an average:
total = 0
for temp in temperatures:
total = total + temp
average = total / len(temperatures)
Tracking the maximum:
highest = temperatures[0] # Start with first value
for temp in temperatures:
if temp > highest:
highest = temp
Formatting decimals:
average = 73.14285714
print(round(average, 1)) # Prints: 73.1
Rubric
See the Project 1 Rubric for detailed grading criteria.
Grading Summary
| Criterion | Points |
|---|---|
| Correctness | 40 |
| Code Quality | 30 |
| Output Format | 20 |
| Documentation | 10 |
| Total | 100 |
Submission
- Name your file
weather_report.py - Push to your GitHub repository by Week 5
- Verify your code runs without errors before submitting
Academic Integrity
- You may discuss approaches with classmates, but write your own code
- You may use course materials and notes
- You may NOT copy code from the internet or other students
- You may NOT use AI to write your code (using it to understand concepts is OK)
Getting Help
- Start early—don't wait until the day before!
- Office hours are great for getting unstuck
- Post conceptual questions on the discussion forum
- Come to the project work session in Week 4