Create a menu-driven program that will allow only to accept a number and
provide an error message if the wrong option is selected from the menu.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com
My programming website is http://www.jakerpomperada.blogspot.com
I am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/
Program Listing
print();
def print_menu():
print(20 * "-",
"MENU", 20 * "-");
print("\t1. Menu Option
1");
print("\t2. Menu Option
2")
print("\t3. Menu Option
3");
print("\t4. Menu Option
4");
print("\t5. Exit");
print(45 * "-");
loop = True
while loop:
print_menu()
try:
choice =
int(input("\tEnter your choice [1-5]: "));
except ValueError:
print("\tIt's not a
number! Try again");
if choice == 1:
print();
print("\tMenu 1 has
been selected");
elif choice == 2:
print();
print("\tMenu 2 has
been selected");
elif choice == 3:
print();
print("\tMenu 3 has
been selected");
elif choice == 4:
print();
print("\tMenu 4 has
been selected");
elif choice == 5:
print();
print("\tMenu 5 has
been selected ");
print("\tQuit Program
and Return to Windows");
loop = False
else:
print("\tWrong
option selection. Select Again.");