-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckbook.py
More file actions
48 lines (40 loc) · 1.26 KB
/
Copy pathcheckbook.py
File metadata and controls
48 lines (40 loc) · 1.26 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
bal=126000
def current_balance(bal):
print("Available Balance is:",bal)
def Deposit(amount,bal):
return(bal+amount)
current_balance()
def Withdrawal(amount,bal):
return (bal-amount)
current_balance()
with open('checkbook_history.txt') as f:
bal=f.read()
bal=int(bal)
print(" ~~~~~~~~~ HELLO, WELCOME BACK! ~~~~~~~~~")
while True:
print("Please Select an option:")
print(" ")
print("1. View Current Balance")
print("2. Make a Withdrawal")
print("3. Make a Deposit")
print("4. Exit")
choice=input("Choice?")
if choice =="1":
current_balance(bal)
elif choice== "2":
amount=int(input("How much would you like to withdraw?"))
bal=Withdrawal(amount,bal)
current_balance(bal)
elif choice=="3":
amount=int(input("How much would you like to deposit?"))
bal=Deposit(amount,bal)
Deposit(amount,bal)
current_balance(bal)
elif choice=="4":
print("THANK YOU, HAVE A GREAT DAY!")
with open('checkbook_history.txt', 'w') as f:
f.write(str(bal))
break
else:
print("PLEASE SELECT OPTIONS 1 THROUGH 4")
print(" ")