Write a clear prompt for an order total function

Vibe codingEasy20 min

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"}
  • amount is a string, because it comes from a JSON API
  • status is one of paid, pending or refunded
  • 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?