-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathATM Bank system.py
69 lines (64 loc) · 2.59 KB
/
ATM Bank system.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os;
# Simple Banking System with few banking services...
print("Welcome to ROOT-TECH.inc...")
chances = 3
balance = 10000
pin = 1234
restart = 'Y'
#Looping throught the options
while chances > 0:
print("Enter your 4 digits pin")
print(f"Chances left: {chances}")
entered_pin = int(input(">"))
if entered_pin == pin:
while restart not in ['N', 'NO', 'no', 'No', 'nO']:
print("Enter 1 to check balance:\n")
print("Enter 2 to deposit funds:\n")
print("Enter 3 to withdraw funds:\n")
print("Enter 4 to return card:\n")
option = int(input(">"))
if option == 1:
print(f"Your balance is : ${balance}")
print("Do you want to go perform another operation (Y/N)")
restart = input(">")
if restart in ['N', 'NO', 'no', 'No', 'nO']:
print("Have a nice day😀\n")
break
elif option == 2:
print("Enter desired amount")
balance += float(input(">"))
print("Do you want to go perform another operation (Y/N)")
restart = input(">")
if restart == 'N':
print("Have a nice day😉\n")
break
elif option == 3:
print("Enter amount: ")
withdraw = float(input(">"))
if balance > withdraw:
balance -= withdraw
print(f"Withdraw of ${withdraw} completed successfully...")
print("Do you want to go perform another operation (Y/N)")
restart = input(">")
if restart.upper() == 'N':
print("Have a nice day😀\n")
break
else:
print("Insuficient😥 Funds Recharge you account!")
print("Do you want to go perform another operation (Y/N)")
restart = input(">")
if restart.upper() == 'N':
print("Have a nice day\n")
break
elif option == 4:
print("Wait while card is being ejected...")
# print("Do you want to go perform another operation (Y/N)")
print("Have a nice day😉\n")
break
elif entered_pin != pin:
print("Incorrect Pin")
chances = chances-1
print(f"Chances left: {chances}")
if chances == 0:
print("Failled to enter correct pin")
break