-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbanks_appliation.py
More file actions
36 lines (35 loc) · 1.14 KB
/
Copy pathbanks_appliation.py
File metadata and controls
36 lines (35 loc) · 1.14 KB
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
35
36
import sys
class Customer:
''' Customer bank related operation'''
bankname="MAYANK_BANK"
def __init__(self,name,balance=0):
self.name=name
self.balance=balance
def deposit(self,amt):
self.balance=self.balance+amt
print('After deposit your balance is',self.balance)
def withdraw(self,amt):
if amt>self.balance:
print("Insufficient balance")
sys.exit()
self.balance=self.balance-amt
print("After withdraw your current balance is",self.balance)
def exit():
print("Thanks for BANKING")
sys.exit()
print("Welcome to",Customer.bankname)
name=input("Enter the name")
c=Customer(name)
while True:
print("d-DEPOSIT\nw-WITHDRAW\ne-exit")
option=input("Enter the suitable options")
if option=='d' or option=='D':
amt=float(input("Enter the amount that you want to deposit"))
c.deposit(amt)
elif option=='w' or option=="W":
amt=float(input("Enter the amount that you want to withdraw"))
c.withdraw(amt)
elif option=="e" or option=='E':
exit()
else:
print("Choose the valid options")