CSE 110 | Programming Building Blocks

12 Prepare: Checkpoint

Overview

This checkpoint will help you practice finding things in a list.

Assignment

To simplify your program to focus on the task at hand, instead of reading from a file, please copy and paste the following list of people and their ages into your program:


people = [
    "Stephanie 36",
    "John 29",
    "Emily 24",
    "Gretchen 54",
    "Noah 12",
    "Penelope 32",
    "Michael 2",
    "Jacob 10"
]

Write a program to find the youngest person in the list.

Consider following these steps to build up to the finished program:

  1. Iterate through the list and display each string to the screen.

  2. Split the string into a name and age and print them to the screen.

  3. Find the age that is the youngest.

  4. Keep track of the name of the person that is the youngest.

Sample Solution

When your program is finished, please view a sample solution of this program to compare your approach to that one.

You should work to complete this checkpoint program first, without looking at the sample solution. However, if you have worked on it for at least an hour and are still having problems, you may feel free to use the sample solution to help you finish your program.

Testing Procedure

Because there is no user input, you don't need to test the program with different values. Instead, make sure that that following components are in place:

  1. The list of people is included in the program.

  2. The program can iterate through each string in the list.

  3. The program can split the string into the appropriate pieces.

  4. The youngest age is identified.

  5. The name of the youngest person is identified.

Submission

When complete, please report your progress in the associated I-Learn quiz.