Question: Type in the code below to display a menu system and perform a task. Create a function called do _ something that simply displays what

Type in the code below to display a menu system and perform a task. Create a function called
do_something that simply displays what was done. Be sure to build in an error checking mechanism
that warns the user of an invalid choice. Hint: your function will incorporate an IF test to determine
what is output. (7 points)
def main():
print_menu()
choice = int(input("Please enter choice: "))
do_something(choice) #function call
def print_menu():
print("1. Create username")
print("2. Delete user")
print("3. Change address")
print("0. Exit program")
main()
Sample output:
1. A username was created
2. A user was deleted
3. An address was changed
0. Exit
Please enter choice: 2
A user was deleted

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 Programming Questions!