-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBank operation class.py
More file actions
28 lines (26 loc) · 967 Bytes
/
Bank operation class.py
File metadata and controls
28 lines (26 loc) · 967 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
class bank:
def __init__(self,amount,balance):
self.amount=amount
self.balance=balance
def deposit(self):
self.balance=self.amount+self.balance
print("\n\t\t\t Amount to Deposits:",self.balance)
def Withdraw(self):
self.balance=self.amount-self.balance
print("\n\t\t\t Amount in Withdraw : ",self.balance)
print("\n\n\n\t\t\t BANK OPERATION USING CLASS ")
print("\t\t\t -------------------------- ")
while True:
balance1=int(input("\n\t\t\t Amount already in balance :"))
amt=int(input("\n\t\t\t Amount to Withdraw or deposit: "))
p1=bank(balance1,amt)
print("\n\n\t\t\t MENU : ")
print("\t\t\t ------ ")
print("\n\t\t\t 1. Deposit \n\t\t\t 2. Withdrawal ")
ch=input("\n\t\t\t Enter your choice :")
if ch=="1":
p1.deposit()
elif ch=="2":
p1.Withdraw()
if input("\n\n\t\t\t Do you want to continue:")!='y':
break