Texts: (just needed help for context)
menu() will do three things, in this order: call the print_menu() function to print out the options. Ask the user to input an option. Attempt to convert the user input to an integer. If the user input cannot be converted, catch the error, ask the user to enter a number next time.
Use an if/elif/else pattern to respond to the user. There should be a unique response for each valid choice. That means that the response to choice 4 must be different from the response to choice 5. If the user enters an integer but it is not a valid choice (not 1-7 or 9), then let the user know that they must choose from the list.
It is important that try blocks contain as little code as possible, otherwise you risk covering up errors that you are not aware of. Your try block should contain only one line of code:
You must have three functions: main(), menu() and print_menu()
menu() should be called from within the main() function, right after the polite greeting is complete. You already coded the polite greeting in Assignment One.
print_menu() should be called from within the menu() function. A common mistake is calling print_menu() directly from main().
You must use a try/except block. The try block should only contain one line of code.
Bare exceptions are dangerous, so be sure to specify the exception you are expecting. If you are not sure what exception will be raised, then write your code without the try/except, run the program and enter a non-numeric character, and observe what exception is raised. Go back and add the try/except block using that exception.
You must use an if/elif/else pattern.