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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education