promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

Functions and the hallucinated return — step 8 of 8

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

One last thing. AI wrote a function discount that's supposed to take a price and a percent off, and hand back the new price. The function body is missing the line that does the math and returns the answer.

Finish the function so the script prints final: 80.0.

full-screen editor opens — close anytime to keep reading.