1
- from __future__ import print_function
2
1
import numpy as np
3
2
4
3
@@ -7,15 +6,15 @@ class Account:
7
6
def __init__ (self ):
8
7
self .amount = 0
9
8
10
- def putMoney (self , deposit ):
9
+ def put_money (self , deposit ):
11
10
print ("my amount is" , self .amount )
12
11
self .amount += deposit
13
12
print ("my amount is" , self .amount )
14
13
15
- def takeMoney (self , withdrawal ):
14
+ def take_money (self , withdrawal ):
16
15
self .amount -= withdrawal
17
16
18
- def printAmount (self ):
17
+ def print_amount (self ):
19
18
print ("my amount is" , self .amount )
20
19
print (self .amount )
21
20
@@ -25,15 +24,15 @@ class BankAccount:
25
24
def __init__ (self ):
26
25
self .accounts = [Account () for i in np .arange (1000 )]
27
26
28
- def putMoney (self , account , deposit ):
27
+ def put_money (self , account , deposit ):
29
28
self .accounts [account ].putMoney (deposit )
30
29
31
- def takeMoney (self , account , withdrawal ):
30
+ def take_money (self , account , withdrawal ):
32
31
self .accounts [account ].takeMoney (withdrawal )
33
32
34
- def printAmount (self , account ):
33
+ def print_amount (self , account ):
35
34
self .accounts [account ].printAmount ()
36
35
37
36
a = BankAccount ()
38
- a .putMoney (5 , 100 )
39
- a .printAmount (5 )
37
+ a .put_money (5 , 100 )
38
+ a .print_amount (5 )
0 commit comments