1. Write a Python program named LastnameFirstname08.py, using your last name and your first name, that does the following:

  • Define 3 functions that meet the following criteria:
    • Function 1: Has at least 2 parameters. Generates a random number. Depending on what number is chosen, recommend something to the user (a movie, what to eat for dinner, etc - your choice!)
    • Function 2: Has at least 3 parameters. Prints a message that somehow involves all parameters.
    • Function 3: Has at least 1 number parameter and returns a value related to the parameter.
  • Define a main function. In the function, do the following steps:
    • Ask the user for their name, and say hello to them using their name.
    • List the different tasks your 3 functions can do.
    • Within a loop, do the following:
      • Ask the user which function they'd like to execute.
      • If the user does not give a valid choice, print an error message.
      • If the user gives a valid choice, execute the specified function. For each choice, ask the user for input and pass their input to the function.
      • Ask the user if they'd like to execute another function. If so, let the loop repeat. If not, let the loop end.

2. Be sure to add comments for each section of your code.

3. All code should be in a function, aside from import statements and calling the main function. Call main() only once.

4. Make sure your output is descriptive. Tell the user what you're printing, don't just print out the answers alone.

Expected Output

>>>
=============== RESTART: ManuelNikki08.py ===============
Hi, there! What's your name?
Nikki

Nice to meet you, Nikki!
Check out my super cool program. Here are 3 things it can do!
1. Get a recommendation on what to do this weekend
2. Play a Madlibs game
3. Calculate how much longer this pandemic will last :'-)

What would you like to do? (Enter 1, 2, or 3)
2

Option 2! Sounds great!
Okay, let's play a Madlibs game!
You give me some input, then I'll print a silly story.

Type in a job: astronaut
Type in a food: ice cream
Type in an animal: penguin
Type in a dollar amount: $32.10

Once upon a time, a penguin walked into an grocery store.
Everyone was astonished to see a penguin buying some ice cream.
The penguin paid the cashier $32.10 for the ice cream,
then turned to look at everyone who was staring, and asked them,
"What?! You've never seen an astronaut buy some ice cream before?!"


Would you like to try another function? (Type yes or no)
yes

What would you like to do? (Enter 1, 2, or 3)
1

Option 1! Sounds great!
I'll give you a recommendation on what to do this weekend!

What's the weather gonna be like?
Please type sunny or rainy: rainy
Do you want to do something alone or with friends?
Please type alone or with friends: alone

Hmm... okay... based on your answers, I think you should...
Make some hot chocolate and binge watch something on Netflix!


Would you like to try another function? (Type yes or no)
yes

What would you like to do? (Enter 1, 2, or 3)
100

That's not a valid option!


Would you like to try another function? (Type yes or no)
nah

Uh... You didn't type either yes or no...
I'll just take that as a no. Exiting now.

Thanks for using my program! Bye!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.