-
Notifications
You must be signed in to change notification settings - Fork 1
/
bank_services.py.orig
47 lines (41 loc) · 1008 Bytes
/
bank_services.py.orig
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
37
38
39
40
41
42
43
44
45
46
47
import sys
class Bank:
bankname="Kiran Bank"
def __init__(self,name,balance=0.0):
self.name=name
self.balance=balance
def deposit(self,amt):
self.balance=self.balance+amt
print(amt,"deposited"," Total amount: ",self.balance)
def withdraw(self,amt):
if amt>self.balance:
print("insufficient balance: ", amt)
sys.exit()
self.balance=self.balance-amt
print(amt," deducted from account ", " the remaining balance is: ", self.balance)
print("Welcome: ",Bank.bankname)
name=input("Enter name ")
c=Bank(name)
<<<<<<< HEAD
name=input("Enter name ")
c=Bank(name)
=======
>>>>>>> feature1
while True:
print("select option: Deposit-D/d or Withdraw: W/w or Exit E/e :")
option=input("Select Option: D/W ")
if option=='D':
amt=int(input("enter amount: "))
c.deposit(amt)
<<<<<<< HEAD
elif option=='W':
amt=int(input("enter amount: "))
c.withdraw(amt)
else:
=======
elif option=='E':
print("Thank You:")
sys.exit()
else:
>>>>>>> feature1
print("invalid Option")