Write a clear prompt for an order total function
Your task
You are a junior developer on a Python team, and you need a small function. It takes a list of orders and returns the total revenue, leaving out refunded orders. You are about to ask an AI assistant to write it.
Write the prompt you would give the assistant.
What you know:
- each order is a dict such as
{"id": "A1", "amount": "19.99", "status": "paid"} amountis a string, because it comes from a JSON APIstatusis one ofpaid,pendingorrefunded- finance wants only paid orders counted, and the total exact to the cent
Then, in a few sentences: what would "write a function to total orders" probably get wrong?