|
1 | 1 | # TODO: validate if id given is an integer
|
2 | 2 | fromaccountimportAccount
|
3 | 3 |
|
| 4 | +# for i in range(1, 9): |
| 5 | +# eval(f"account_{i} = Account({i}, 100)") |
| 6 | + |
4 | 7 | account_1=Account(1,100)
|
5 | 8 | account_2=Account(2,100)
|
6 | 9 | account_3=Account(3,100)
|
@@ -37,14 +40,13 @@ def main_menu(id):
|
37 | 40 | withdraw_amount=float(
|
38 | 41 | prompt("Enter the amount of money you would like to withdraw: "))
|
39 | 42 | eval(f"account_{id}.withdraw({withdraw_amount})")
|
40 |
| -print(f"${withdraw_amount} was withdrawed successfully\nYour new balance is{account_{id}.get_balance()}") |
| 43 | +print(f"${withdraw_amount} was withdrawed successfully\nYour new balance is{eval('account_'+id+'.get_balance()')}") |
41 | 44 | get_id()
|
42 | 45 | elif (selection==3):
|
43 | 46 | deposit_amount=float(
|
44 | 47 | prompt("Enter the amount of money you would like to deposit: "))
|
45 | 48 | eval(f"account_{id}.deposit({deposit_amount})")
|
46 |
| -print(f"${deposit_amount} was deposited successfully\n\ |
47 |
| - Your new balance is{account_{id}.get_balance()}") |
| 49 | +print(f"${deposit_amount} was deposited successfully\nYour new balance is{eval('account_'+id+'.get_balance()')}") |
48 | 50 | get_id()
|
49 | 51 | elif (selection==4):
|
50 | 52 | exit()
|
|