-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatm.py
66 lines (47 loc) · 1.94 KB
/
atm.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
import os
def transaction(balance):
print("\nEnter any option to be served!\n")
print("1. Withdraw")
print("2. Deposit")
print("3. Balance\n")
choice = int(input())
if (choice == 1):
print("Please enter amunt to withdraw: ")
amountToWithDraw = int(input())
if (amountToWithDraw > balance):
print("There is no insufficient funds in your account")
print("Do you want another transaction?\nPress 1 to proceed and 2 to exit")
anotherTransaction = int(input())
if (anotherTransaction == 1):
t = os.system("clear")
transaction(balance)
else:
balance -= amountToWithDraw
print("You have withdrawn ${}.00 and your balance is ${}.00".format(amountToWithDraw, balance))
print("Do you want another transaction?\nPress 1 to proceed and 2 to exit")
anotherTransaction = int(input())
if (anotherTransaction == 1):
t = os.system("clear")
transaction(balance)
elif (choice == 2):
print("Please enter amunt to deposit: ")
amountToDeposit = int(input())
balance += amountToDeposit
print("Thank you for depositing, new balance is ${}".format(balance))
print("Do you want another transaction?\nPress 1 to proceed and 2 to exit")
anotherTransaction = int(input())
if (anotherTransaction == 1):
t = os.system("clear")
transaction(balance)
elif(choice == 3):
print("Your bank aount balance is: ${}.00".format(balance))
print("Do you want another transaction?\nPress 1 to proceed and 2 to exit")
anotherTransaction = int(input())
if (anotherTransaction == 1):
t = os.system("clear")
transaction(balance)
else:
t = os.system("clear")
transaction(balance)
balance = 0
transaction(balance)