-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathatm_program.py
More file actions
43 lines (29 loc) · 860 Bytes
/
Copy pathatm_program.py
File metadata and controls
43 lines (29 loc) · 860 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ATM PROGRAM
print("""**********
welcome to atm machine.
Operations:
1.Balance Inquiry
2.Deposit money
3.Withdraw money
Press 'q' to exit the program.
**********
""")
balance = 1000
while True:
operation = input("please enter operation:")
if(operation == "q"):
print("We are waiting for you again")
break
elif(operation == "1"):
print("Your balance is {} TL.".format(balance))
elif(operation == "2"):
amount = int(input("Enter the amount you want to deposit:"))
balance += amount
elif(operation == "3"):
amount = int(input("Enter the amount you want to deposit:"))
if(balance - amount < 0):
print("You cannot withdraw money.")
continue
balance -= amount
else:
print("invalid operation. Please try again.")