You are on page 1of 4

Name______________Atharv___________________ 04.

04 Lists

This assignment has three parts.

Part One: Programming

Write a program to ask the user for their favorite item in a given category. Then provide
feedback if their

item is on your list. Use the following guidelines to write your program.

1. Pick a category and make a list of your five favorite things. Suggested categories include your

favorite: actors, books, cars, or something else of your choosing.

2. Ask the user what their favorites are in your selected category.

3. By creating a list, a loop, and if statements, print a message that lets the user know if their

favorites matches the ones on your list.

4. Neatly print your entire list to the screen. Be sure to number each item.

5. Write the pseudocode for this program. Be sure to include any needed input, calculations,
and

output.

Insert your pseudocode here:

List of favorite car assignment 4.04

Input:

Create a list of 5 cars including (Lamborghini Urus, Bugatti Chiron, Rolls Royce Phantom,

Koenigsegg Regera, Pagani Huayra)

Ask the user for their favorite car assigning it to the variable favoriteCar.

Processing

Go over a list Use a for loop to check if the users favorite is on my list.
If there is a match then print a message.

Output

Print a message “My favorite 5!”

Print the values in my list by numbering them user a for loop.

Part Two: Code the program

1. To code the program, use the Python IDLE.

2. Using comments, type a heading that includes your name, today’s date, and a short
description

of the program.

3. Follow the Python style conventions regarding indentation and the use of white space to

improve readability.

4. Use meaningful variable names.

Example of expected output: The output for your program should resemble the following screen
shot.

Your specific results will vary depending on the choices you make and the input provided.

Insert a copy of your code from IDLE here:

# Atharv Jadhav

# 7/1/2022

# Purpose: This program will ask the user for their favorite car

# then check if its in the programmers list, if it is there then,

# We print a message saying that is also one of mine giving my list.


def main():

cars = ("Lamborghini Urus", "Bugatti Chrion", "Rolls Royce Phantom", "Koenigsegg


Regera","Pagani Huayra")

print("What is your favorite car? Be specific!")

favoriteCar = input("Enter your favorite car! Be specific.")

for c in range(0, len(cars)):

if favoriteCar == cars[c]:

print("Wow! We both like " + cars[c] + "!")

print("=================================")

print(" Here are my top 5 favorites!: ")

for c in range(0, len(cars)):

print(str(c+1) + " " + cars[c])

main()

Part Three: Post Mortem Review

Complete the Post Mortem Review (PMR). Write thoughtful two to three sentence responses to
all the questions in the PMR chart.

What was the purpose of your program? This program will ask the user for their
favorite car
Then check if it’s in the programmer list, if it is
there then we print a message saying that is
also one of mine giving my list.

How could your program be useful in the real My program could be used in the real world
world? as a talking app, where people could
communicate.

What is a problem you ran into, and how did A problem I ran into was I accidentally kept
you fix it? on putting the parenthesis instead of braces.

Describe one thing you would do differently The next time I would make sure to use the
next time you write a program. correct syntax/parenthesis and braces.

You might also like