-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimple-Menu.py
More file actions
41 lines (33 loc) · 939 Bytes
/
Copy pathSimple-Menu.py
File metadata and controls
41 lines (33 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
def main_menu():
while True:
print("\nMain Menu")
print("1. Option 1")
print("2. Option 2")
print("3. Option 3")
print("4. Option 4")
print("5. Exit")
choice = input("Choose an option (1-5): ")
if choice == '1':
handle_choice_1()
elif choice == '2':
handle_choice_2()
elif choice == '3':
handle_choice_3()
elif choice == '4':
handle_choice_4()
elif choice == '5':
print("Exiting the program.")
break
else:
print("Invalid choice. Please try again.")
def handle_choice_1():
print("You chose option 1.")
def handle_choice_2():
print("You chose option 2.")
def handle_choice_3():
print("You chose option 3.")
def handle_choice_4():
print("You chose option 4.")
if __name__ == "__main__":
main_menu()