-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbank.py
More file actions
33 lines (22 loc) · 696 Bytes
/
bank.py
File metadata and controls
33 lines (22 loc) · 696 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
26
27
28
29
30
class BankAccount:
def __init__(self,acc_no ,name,date_of_open , balance ):
self.acc_no = acc_no
self.date_of_open = date_of_open
self.balance = balance
self.name = name
def deposite(self,amount):
self.balance += amount
print("Deposited:",amount,"Balance:",self.balance)
def debit(self,amount):
if amount <= self.balance :
self.balance -= amount
print("Debited:",amount,"Balnce:",self.balance)
else :
print("not sufficient balance")
def CheckBalance(self):
print("Balance:",self.balance)
bank = BankAccount(1001003067,"Rahul","01-03-2004",9000)
bank.CheckBalance()
bank.deposite(25000)
bank.debit(4000)
bank.CheckBalance()