BYU logo Computer Science

To start this assignment, download this zip file.

The following guide pages cover material needed for this assignment:

Homework 3f — Structured Data

1. Pokemon

Write a program that queries the user for a sequence of Pokemon.

For each pokemon, the user will provide a name, type, and hit-points (HP) value.

The user provides an empty name to indicate they are done providing pokemon data.

Then the program queries the user for a pokemon type and prints the pokemon that has the maximum HP for that type.

Use the prompts and formatting as demonstrated in the example.


Name: Charmander
Type: Fire
HP: 39
Name: Squirtle
Type: Water
HP: 44
Name: Blastoise
Type: Water
HP: 79
Name: Charizard
Type: Fire
HP: 78
Name: Rattata
Type: Normal
HP: 30
Name: Mudkip
Type: Water
HP: 50
Get max HP for type: Water
Blastoise has the highest HP (79) for type Water.

2. Date Ideas

Write a program that helps the user organize date ideas.

Each idea has a description and a cost.

The user provides an empty idea to indicate they are done entering ideas.

Then the program queries the user for a maximum date cost and displays all the dates that are of equal or lesser cost.

Follow the prompts and formatting of the example.


Date idea: Running
Date cost: 0
Date idea: Ice Cream
Date cost: 15
Date idea: Bowling
Date cost: 20
Date idea: Fancy Dinner
Date cost: 70
Date idea: Hiking the Y
Date cost: 0
Date idea: 
Get max cost for date: 20
Here are all the dates below $20:
- Running costs $0.
- Ice Cream costs $15.
- Bowling costs $20.
- Hiking the Y costs $0.


Be sure you can pass the tests before you turn in the assignment. Review the guide on using pytest if you need to review using pytest and what to do if a test fails.


Date Ideas10

Manual Grading

Refer to the Quality Code guide page for detailed explanations and examples on each of these rubric criteria.


The intent of this assignment is for you to create lists of tuples from input, and use the list patterns to work with list of tuples.

It’s ok to use lists of strings or integers if that simplifies the problem, but you shouldn’t use a dictionary (Unit 5).