MCPcopy Create free account
hub / github.com/geekcomputers/Python / menu

Function menu

Hotel-Management.py:1–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1def menu():
2 options = {
3 1: {"title": "Add new customer details", "method": lambda: add()},
4 2: {
5 "title": "Modify already existing customer details",
6 "method": lambda: modify(),
7 },
8 3: {"title": "Search customer details", "method": lambda: search()},
9 4: {"title": "View all customer details", "method": lambda: view()},
10 5: {"title": "Delete customer details", "method": lambda: remove()},
11 6: {"title": "Exit the program", "method": lambda: exit()},
12 }
13
14 print(f"\n\n{' ' * 25}Welcome to Hotel Database Management Software\n\n")
15
16 for num, option in options.items():
17 print(f"{num}: {option.get('title')}")
18 print()
19
20 options.get(int(input("Enter your choice(1-6): "))).get("method")()
21
22
23def add():

Callers 6

modifyFunction · 0.85
searchFunction · 0.85
removeFunction · 0.85
viewFunction · 0.85
exit_menuFunction · 0.85

Calls 7

modifyFunction · 0.85
viewFunction · 0.85
exitFunction · 0.85
addFunction · 0.70
searchFunction · 0.70
removeFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected