1 # the following code is an expense report to help the user keep tack of expenses : 2 import datetime 3 #initilising an empty dict to store any expenses 4 expenses = {} 5 expenses_dict= {"Food": [], "Transport": [], "Entertainment": [], "Work": []} 6 7 8 9 10 11 v 12 v 13 14 15 v 16 17 18 19 20 21 v 22 23 24 25 def add_expense(): V print("Please add an Expense: ") item_name = input("Item Name: ") category =input("Category (Food/Transport/Entertainment/work): ") while True: try: } 26 27 28 ក AI (~} Python #grabbing the current date and time: timestamp = datetime.datetime.now() #storing the expense in the dict expenses[timestamp] ={ "item_name": item_name, "category": category, "amount": amount amount = float(input("Amount: £")) break except ValueError: print("Invalid input. please enter a valid amount.") print("Expense added\n") def calculate_total(): batal
1 # the following code is an expense report to help the user keep tack of expenses : 2 import datetime 3 #initilising an empty dict to store any expenses 4 expenses = {} 5 expenses_dict= {"Food": [], "Transport": [], "Entertainment": [], "Work": []} 6 7 8 9 10 11 v 12 v 13 14 15 v 16 17 18 19 20 21 v 22 23 24 25 def add_expense(): V print("Please add an Expense: ") item_name = input("Item Name: ") category =input("Category (Food/Transport/Entertainment/work): ") while True: try: } 26 27 28 ក AI (~} Python #grabbing the current date and time: timestamp = datetime.datetime.now() #storing the expense in the dict expenses[timestamp] ={ "item_name": item_name, "category": category, "amount": amount amount = float(input("Amount: £")) break except ValueError: print("Invalid input. please enter a valid amount.") print("Expense added\n") def calculate_total(): batal
Chapter8: Arrays
Section: Chapter Questions
Problem 7PE
Related questions
Question
im really stuck on creating a few simple replit tests (unit tests )for the following code in the pictures below . may you please help me with this.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage