-
Notifications
You must be signed in to change notification settings - Fork 0
/
midterm.py
43 lines (36 loc) · 1.13 KB
/
midterm.py
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
print("Welcome to ABC Bank ATM")
password = 1234
balance = 1080.50
attempt = 0
while attempt <= 3:
pEntry = eval(input("Please enter your 4 digit pin:"))
if pEntry == password:
break
else:
print("Incorrect Password")
attempt += 1
if attempt == 3:
print("No more tries")
else:
print("Please Press 1 for Checking Balance")
print("Please Press 2 To Make Withdrawal")
choice = eval(input("What would you like to choose?"))
while True:
if choice == 1:
print("Your balance is:", balance)
break
elif choice ==2:
while True:
amount = eval(input("Enter withdrawal amount:"))
if amount == 50 or amount == 100 or amount == 200 or amount == 500 or amount == 1000 or amount == 1500:
break
else:
print("Invalid entry")
if amount > balance:
print("INSUFFICIENT BALANCE")
break
else:
print("Your balance is now:", balance-amount)
break
else:
print("Invalid entry")