24.5k views
2 votes
Python Project Worksheet

Print | Save
Output: Your goal
You will write a program that asks a user to fill in a story. Store each response in a variable, then print the story based on the responses.

Part 1: Plan and Write the Pseudocode
Use the following guidelines to write your pseudocode for a fill-in story program.

Decide on a list of items the program will ask the user to input.
Your program should include at least four interactive prompts.
Input from the user should be assigned to variables and used in the story.
Use concatenation to join strings together in the story.
Print the story for the user to read.


Write your pseudocode here:










Part 2: Code the Program
Use the following guidelines to code your program.

Use the Python IDLE to write your program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Set up your def main(): statement. (Don’t forget the parentheses and colon.)
Conclude the program with the main() statement.
Include at least two print statements and two variables.
Include at least four input prompts.
Use concatenation to join strings.
Follow the Python style conventions regarding indentation in your program.
Run your program to ensure it is working properly. Fix any errors you may observe.
Example of expected output: The output below is an example of a “Favorite Animal” message. Your specific results will vary depending on the choices you make about your message.

Output
The kangaroo is the cutest of all. It has 5 toes and a beautiful heart. It loves to eat chips and salsa, although it will eat pretty much anything. It lives in New York, and you must be super sweet to it, or you may end up as its meal!


When you've completed writing your program code, save your work by selecting 'Save' in the Python IDLE. When you submit your assignment, you will attach this Python file separately.

Part 3: Post Mortem Review (PMR)
Using complete sentences, respond to all the questions in the PMR chart.

Review Question Response
What was the purpose of your program?
How could your program be useful in the real world?
What is a problem you ran into, and how did you fix it?
Describe one thing you would do differently the next time you write a program.

User SteveGoob
by
8.8k points

1 Answer

2 votes

Part 1: Pseudocode

  1. Prompt the user to enter their name and store it in a variable.
  2. Prompt the user to enter their favorite color and store it in a variable.
  3. Prompt the user to enter their favorite animal and store it in a variable.
  4. Prompt the user to enter their favorite food and store it in a variable.
  5. Concatenate the variables with a story template to create the final story.
  6. Print the story for the user to read.

Part 2: Code the Program

# Fill-in Story Program

def main():

# Prompt the user for their name and store it in a variable

name = input("Enter your name: ")

# Prompt the user for their favorite color and store it in a variable

color = input("Enter your favorite color: ")

# Prompt the user for their favorite animal and store it in a variable

animal = input("Enter your favorite animal: ")

# Prompt the user for their favorite food and store it in a variable

food = input("Enter your favorite food: ")

# Create the story using concatenation

story = "The " + animal + " is the most beautiful " + color + " creature in the world. " + name + " loves to eat " + food + " and dreams of traveling the world with " + animal + " by their side."

# Print the story

print(story)

if __name__ == "__main__":

main()

Part 3: Post Mortem Review (PMR)

Review Question Response

  1. The purpose of the program is to create a fill-in story where the user can input their name, favorite color, favorite animal, and favorite food to personalize the story.
  2. This program could be useful in creating personalized stories for entertainment or as a creative writing tool for children.
  3. One problem I ran into was not properly using the concatenation operator (+) to join strings in the story. I fixed it by reviewing the code and adding the concatenation operator where needed.
  4. Next time, I would consider adding more prompts and variables to make the story even more personalized and engaging for the user.
User Jatin Pandey
by
8.2k points

No related questions found