08 Checkpoint: Dictionaries

Purpose

Improve your ability to use dictionaries in a Python program.

Helpful Documentation

Assignment

Write a program that stores information about vehicles in a Python dictionary. Your program must ask a user to enter a vehicle identification number (VIN), then find that VIN in the dictionary, and print the manufacturer, model, and color of the vehicle. Do the following:

  1. Download and save the vehicles.py Python file and then open it in VS Code.
  2. Using VS Code, read the comments in the program. Then replace all three occurrences of the keyword pass with code that does what the comments describe.
  3. Run your program and verify that it works correctly.

Testing Procedure

Verify that your program works correctly by following each step in this testing procedure:

  1. Run your program and enter the inputs shown below. Ensure that your program’s output matches the output below.
    > python vehicles.py
    Please enter a VIN: QT71603
    QT71603 is not in the dictionary.
    
    > python vehicles.py
    Please enter a VIN: 5TDZA23CXTU102983
    Toyota Sienna gold

Sample Solution

When your program is finished, view the sample solution for this assignment to compare your solution to that one. Before looking at the sample solution, you should work to complete this checkpoint program. However, if you have worked on it for at least an hour and are still having problems, feel free to use the sample solution to help you finish your program.

Submission

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