11
11
account_8 = Account (8 ,100 )
12
12
account_9 = Account (9 ,100 )
13
13
14
+
14
15
def get_id ():
15
16
global id
16
17
id = input ("Enter an account id" )
@@ -20,6 +21,7 @@ def get_id():
20
21
print ("Invalid id, try again!" )
21
22
get_id ()
22
23
24
+
23
25
def main_menu (id ):
24
26
print ("Main Menu\n \
25
27
1: check balance\n \
@@ -31,19 +33,23 @@ def main_menu(id):
31
33
if (selection == 1 ):
32
34
print (eval (f"account_{ id } .get_balance()" ))
33
35
get_id ()
34
- else if (selection == 2 ):
35
- withdraw_amount = float (prompt ("Enter the amount of money you would like to withdraw: " ))
36
+ elif (selection == 2 ):
37
+ withdraw_amount = float (
38
+ prompt ("Enter the amount of money you would like to withdraw: " ))
36
39
eval (f"account_{ id } .withdraw({ withdraw_amount } )" )
37
40
print (f"${ withdraw_amount } was withdrawed successfully\n Your new balance is{ account_ {id }.get_balance ()} " )
38
41
get_id ()
39
- else if (selection == 3 ):
40
- deposit_amount = float (prompt ("Enter the amount of money you would like to deposit: " ))
42
+ elif (selection == 3 ):
43
+ deposit_amount = float (
44
+ prompt ("Enter the amount of money you would like to deposit: " ))
41
45
eval (f"account_{ id } .deposit({ deposit_amount } )" )
42
- print (f"${ deposit_amount } was deposited successfully\n Your new balance is{ account_ {id }.get_balance ()} " )
46
+ print (f"${ deposit_amount } was deposited successfully\n \
47
+ Your new balance is{ account_ {id }.get_balance ()} " )
43
48
get_id ()
44
- else if (selection == 4 ):
49
+ elif (selection == 4 ):
45
50
exit ()
46
- else :
51
+ else :
47
52
print ("Error" )
48
53
54
+
49
55
get_id ()