forked from Arindam200/Python_Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM_Program.py
More file actions
49 lines (38 loc) · 1.33 KB
/
Copy pathATM_Program.py
File metadata and controls
49 lines (38 loc) · 1.33 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
# PYTHON ATM PROGRAM BY PYTHONDEX
# Visit https://pythondex.com for more information
user = {
'pin': 1234,
'balance':1000
}
def widthdraw_cash():
while True:
amount = int(input("Enter the amount of money you want to widthdraw: "))
if amount > user['balance']:
print("You don't have sufficient balance to make this widthdrawal")
else:
user['balance'] = user['balance'] - amount
print(f"{amount} Dollars successfully widthdrawn your remaining balance is {user['balance']} Dollars")
print('')
return False
def balance_enquiry():
print(f"Total balance {user['balance']} Dollars")
print('')
is_quit = False
print('')
print("Welcome to the Pythondex ATM")
pin = int(input('Please enter your four digit pin: '))
if pin == user['pin']:
while is_quit == False:
print("what do you want to do")
print(" Enter 1 to Widthdraw Cash \n Enter 2 for Balance Enquiry \n Enter 3 to Quit")
query = int(input("Enter the number corresponding to the activity you want to do: "))
if query == 1:
widthdraw_cash()
elif query == 2:
balance_enquiry()
elif query == 3:
is_quit = True
else:
print("Please enter a correct value shown")
else:
print("Entered wrong pin")