-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM Function.py
More file actions
51 lines (51 loc) · 1.84 KB
/
ATM Function.py
File metadata and controls
51 lines (51 loc) · 1.84 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ATM pin validation
print("Welcome to Lotus Investments Bank Ltd !!!")
print("Please Insert Your ATM card")
print("processing....")
atmpin=2012
chance=3
balance=50000
options=4
inputpin=int(input("Please Enter your four digit pin:"))
while chance>0:
if inputpin!=atmpin:
print("Incorrect pin")
inputpin=int(input("please re-Enter your four digit pin:"))
chance=chance-1
elif inputpin==atmpin:
print("Login success")
break
else:
print("You have done Maximum attempt, Your card is blocked. Please contact your Bank")
if inputpin==atmpin:
print("1.Balance")
print("2.Deposit")
print("3.Withdraw")
print("4.cancel")
options=int(input("Please select Your option, (1, 2, 3, 4): "))
while options>0:
if options==1:
print("Your Current Balance is Rs:", balance)
options=int(input("Please select Your option, (1, 2, 3, 4): "))
elif options==2:
deposit=int(input("Please Enter the amount to deposit Rs: " ))
balance+=deposit
print("Deposited amount is Rs:", deposit)
print("Your Current Balance is Rs:", balance)
options=int(input("Please select Your option, (1, 2, 3, 4): "))
elif options==3:
withdraw=int(input("Please Enter the amount to withdraw Rs: " ))
if balance < withdraw:
print("Insuffient balance")
else:
balance-=withdraw
print("withdrawal amount is Rs:", withdraw)
print("Your Current Balance is Rs:", balance)
options=int(input("Please select Your option, (1, 2, 3, 4): "))
elif options==4:
print("Exit")
break
else:
print("invalid Entry")
break
options=options