@@ -15,7 +15,7 @@ def check_balance(self): # going into self to retrieve balance from what you hav
15
15
def deposit (self , amount ):
16
16
self .balance += amount
17
17
self .transactions .append (f'user deposited { amount } ' )
18
-
18
+ return self . balance
19
19
20
20
def check_withdrawal (self , amount ): #using self to get balance and amount since thats what we're checking
21
21
if self .balance >= amount :
@@ -26,13 +26,16 @@ def check_withdrawal(self, amount): #using self to get balance and amount since
26
26
def withdraw (self , amount ):
27
27
self .balance -= amount
28
28
self .transactions .append (f'user withdrew { amount } ' )
29
-
29
+ return self .balance
30
+
30
31
def calc_interest (self ):
31
32
interest = self .balance * self .intrest_rate * .01
32
33
return interest
33
34
34
35
def print_transactions (self ):
35
- print (self .transactions )
36
+ for i in self .transactions :
37
+ print (i )
38
+ return self .transactions
36
39
37
40
38
41
# atm = ATM(5, .001) #putting the values for the initializer.its an object
@@ -68,7 +71,8 @@ def print_transactions(self):
68
71
atm .deposit (amount )
69
72
print (f'Accumulated ${ amount } in interest' )
70
73
elif command == "transactions" :
71
- atm .print_transactions ()
74
+ transactions = atm .print_transactions ()
75
+ print (f'your transaction history is { transactions } ' )
72
76
elif command == 'help' :
73
77
print ('Available commands:' )
74
78
print ('balance - get the current balance' )
0 commit comments