Question: My python code should have a function for printing welcome info and a menu, a function to get the user input and return a valid

My python code should have a function for printing welcome info and a menu, a function to get the user input and return a valid choice, and have a main function that calls the functions in the appropriate order and outputs valid choice. My code below, seems to be off.

def main():

def welcomemenu(): print('Welcome to the area computation tool') print('******MENU******') print('tri Compute area of a triangle') print('trap Compute area of a tapezoid') print('quit Quit the tool') welcomemenu() userinput = input('Please enter your choice: ') while True: if (userinput == 'tri'): print('You chose: tri') elif (userinput == 'trap'): print('You chose: trap') elif (userinput == 'quit'): exit(0) else (userinput + 'is an invalid choice')

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!