-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinance.py
More file actions
65 lines (51 loc) · 2.15 KB
/
Copy pathfinance.py
File metadata and controls
65 lines (51 loc) · 2.15 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# this program will track the deposit, withdrawal, expenses and balance
balance = 0
def deposit():
# AMOUNT IN DOLLARS
deposit_amount = float(input("Input amount of deposit: "))
return deposit_amount
balance += deposit()
def withdrawal():
# AMOUNT IN DOLLARS
withdrawal_amount = float(input("Input amount to withdraw: "))
if withdrawal_amount > balance:
print("Insufficient funds.")
else:
print("Withdrawal of", withdrawal_amount, "is successful")
return withdrawal_amount
item_dictionary = {"egg": 2500, "rice": 30000, "beans": 35000, "garri": 15000}
item = ["egg", "rice", "beans", "garri"]
while True:
item_1 = input("Item to buy(1): ").lower()
if item_1.lower() in item:
if item_1 in item_dictionary:
print("Item in store.")
if item_1 == item[0]:
print("The price of", item_1, "is", item_dictionary["egg"])
elif item_1 == item[1]:
print("\nThe price of", item_1, "is", item_dictionary["rice"])
elif item_1 == item[2]:
print("\nThe price of", item_1, "is", item_dictionary["beans"])
elif item_1 == item[3]:
print("\nThe price of", item_1, "is", item_dictionary["garri"])
break
item_2 = input("\nItem to buy(2): ").lower()
if item_2.lower() in item:
if item_2 in item_dictionary:
print("Item in store.")
if item_2 == item[0]:
print("The price of", item_2, "is", item_dictionary["egg"])
elif item_2 == item[1]:
print("\nThe price of", item_2, "is", item_dictionary["rice"])
elif item_2 == item[2]:
print("\nThe price of", item_2, "is", item_dictionary["beans"])
elif item_2 == item[3]:
print("\nThe price of", item_2, "is", item_dictionary["garri"])
break
else:
print("No price for the selected item")
else:
print("Item in store but not in shelf")
else:
print("Item not in store")
print("Successfully deployed")