Skip to main content
⚑
← Coursesβ€ΊCreative ChallengesModule 4 Β· πŸ› Bug Bounty (10)β€ΊπŸ› Bug Bounty #09: Inventory drops below zerofix39 / 100
πŸ’¬ DiscussπŸ§ͺ Playground+125 XP
Task
πŸ“ **Task:** Make `withdraw` raise `ValueError("insufficient stock")` when `n` exceeds the current stock. πŸ“‹ Implement the function above. Tests run automatically. πŸ’‘ **Hint:** Re-read the theory if stuck.

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only β€” ~5-10s. Stays cached afterward.
πŸ“Š Result
Press Run to see result...
πŸ“£ Help someone learn PythonShare this lesson with a friend β€” the first 15 are free, no signup.Tweet

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…