forked from fenyx-it-academy/Class7-Python-Module-Week4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccount.py
More file actions
25 lines (24 loc) · 692 Bytes
/
Copy pathBankAccount.py
File metadata and controls
25 lines (24 loc) · 692 Bytes
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
class BankAccount:
def __init__(self,accountNumber,name,balance):
self.accountNumber=accountNumber
self.name=name
self.balance=balance
def deposit(self,d):
self.balance+=d
def withdrawal(self,w):
if w <= self.balance:
self.balance-=w
else:
print ("Impossible operation! Insufficient balance!")
def bankFees(self):
self.balance -= (0.05* self.balance)
def display(self):
print(vars(self))
account1 = BankAccount(1,"rama",100)
account1.display()
account1.deposit(200)
account1.display()
account1.bankFees()
account1.display()
account1.withdrawal(50)
account1.display()