Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

=+ Are there additional forms of employee representation?

Answered: 1 week ago

Question

=+What is the nature of their impact?

Answered: 1 week ago