-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbtm_bank.py
38 lines (29 loc) · 869 Bytes
/
btm_bank.py
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
import functionalities as func
options = ["Say hi","Add client","Add transaction","Look at money"]
def show_options():
index = 0
for option in options:
print(index,option)
index += 1
def reception():
print("Welcome to the BTM bank, what can we do for you today ?")
show_options()
def wait_demand():
still_waiting = True
while still_waiting:
demand = int(input("...Choose an option: "))
still_waiting = demand > 0 and demand >= len(options)
return demand
def action_dispatcher(demand):
if demand == 0:
func.say_hi()
elif demand == 1:
func.new_client()
elif demand == 2:
func.new_transaction()
elif demand == 3:
func.look_credit()
if __name__=="__main__":
reception()
demand = wait_demand()
action_dispatcher(demand)