-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM.py
More file actions
28 lines (28 loc) · 837 Bytes
/
ATM.py
File metadata and controls
28 lines (28 loc) · 837 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
"""create a ATM program through Exception handling """
print("welcome to atm")
amount=1000
A=input("press the key(withdrawal,deposite,check balance)")
if A=="withdrawal":
E=int(input("Enter amount: "))
try:
if E<=amount:
amount=amount-E
print("secussfully withdrawal renmaining amount=",amount)
else :
raise Exception ("Enter valid amount")
except Exception as e:
print(e)
elif A=="deposite":
D=int(input("Enter deposite amount: " ))
try:
if D<=0:
raise Exception ("plz Enter valid input")
else:
amount=D+amount
print("your new balance is : ",amount)
except Exception as e:
print(e)
elif A=="check balance":
print(amount)
else:
print("plz press valid key")