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:

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:

  1. Calculate the average temperature for the week
  2. Find the highest and lowest temperatures and which days they occurred
  3. Count how many days were above 75°F (hot days) and below 70°F (cool days)
  4. Classify each day as "Hot" (>75), "Mild" (70-75), or "Cool" (<70)
  5. 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:

  1. Start simple: Just print each day and temperature
  2. Add classification: Add the Hot/Mild/Cool label to each day
  3. Calculate average: Sum all temperatures, divide by count
  4. Find extremes: Track the highest and lowest as you loop
  5. Count categories: Count hot and cool days
  6. 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

CriterionPoints
Correctness40
Code Quality30
Output Format20
Documentation10
Total100

Submission

  1. Name your file weather_report.py
  2. Push to your GitHub repository by Week 5
  3. 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