-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminiproject06.py
More file actions
46 lines (30 loc) · 934 Bytes
/
Copy pathminiproject06.py
File metadata and controls
46 lines (30 loc) · 934 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
44
45
46
#-----------------------------------------------------------------------------------------------------------------
#Mini Project - Expense Tracker
#-----------------------------------------------------------------------------------------------------------------
print("----------Expense Tracker----------")
expenses=[]
while True:
print("1.Add Expense")
print("2.View Expense")
print("3.Total Expense")
print("4.Exit")
choice = int(input("Enter your choice:"))
if choice == 1:
amt=float(input("Enter Expense amount="))
expenses.append(amt)
print("Expense Amount added Successfully!!")
elif choice == 2:
if len(expenses) == 0:
print("No Expense is recorded")
else:
print("\nExpenses:")
for i in expenses:
print(i)
elif choice == 3:
total = sum(expenses)
print("Total Expense:", total)
elif choice == 4:
print("----Exit----")
break
else:
print("Enter a Valid Choice")