-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathBankapp.py
More file actions
34 lines (33 loc) · 884 Bytes
/
Bankapp.py
File metadata and controls
34 lines (33 loc) · 884 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
31
32
33
34
class BankApp:
bname="ICICI"
def __init__(self,cid,cname,bal=0):
print("BankApp constructor")
self.cid=cid
self.cname=cname
self.bal=bal
def deposit(self,amt):
self.bal=self.bal+amt
def withdraw(self,amt):
if self.bal>=amt:
self.bal=self.bal-amt
else:
print("U cannot withdraw ",amt," ur balance is:",self.bal," only")
def balance_eqr(self):
print("Ur balance is:",self.bal)
def details(self):
print("Bank name:",BankApp.bname)
print("Cust name:",self.cname)
print("cust id=",self.cid)
print("cust balance:",self.bal)
b=BankApp(1001,"Shiva")
b.deposit(1000)
b.withdraw(2000)
b.details()
b.withdraw(500)
b.details()
b2=BankApp("1002","Shivakumar",10000)
print("**********")
b2.details()
b2.deposit(20000)
print("------------")
b2.details()