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

  • Define 3 functions that each demonstrate a new concept from Week 8 material and meet the following criteria:
    • Function 1: Uses a string method.
    • Function 2: Has 3 parameters. Prints a message that somehow involves the 3 parameters.
    • Function 3: Has at least 1 string parameter and returns a value related to the parameter.
    • You can make your functions do whatever you want, as long as it adheres to the above criteria!
    • Make sure your comments accurately describe what your function is doing and what new concept it is demonstrating
  • Define a main function. In the function, do the following steps:
    • Ask the user for their name, and say hello to them.
    • 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 at least 2 functions, ask the user for input and pass their input to a function.
      • Ask the user if they'd like to execute another function. If so, let the loop repeat. If not, let the loop end.
  • Provide output so the person running your program clearly understands what's happening in your program (see Example Output). When writing output for your user, use each of the following methods at least once:
    • f-strings
    • str.format
    • % formatting

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.

5. Your program should not use code/concepts we have not yet covered. You must demonstrate that you have mastered the concepts covered in class.

6. Remember to always begin your code with the following documentation comments.

Expected Output

>>>
=============== RESTART: ManuelNikki09.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. FoRmAt yOuR TeXt sO It lOoKs lIkE ThIs
2. Put any three words you give me in alphabetical order
3. Print out your initials

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

Option 3! Sounds great!
First, please enter your first name: nikki
Now, please enter your last name: manuel

Got it! Your initials are: N.M.

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

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

Option 2! Sounds great!
Give me one word: snickers
Give me another word: butterfinger
Give me one last word: m&ms

Here are your words in alphabetical order:
butterfinger m&ms snickers

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.