Intermediate
Write the hand-off rules
Write decide(best, refusals_in_row, asked_for_person, spent, limit) returning one of: "person", "budget", "hand off", "rephrase" or "answer".
Rules, in this order: if asked_for_person return "person". If spent >= limit return "budget". If best < 0.30: return "hand off" when refusals_in_row >= 1, otherwise "rephrase". Otherwise return "answer".
What Check tests
- A good match is answered
- A weak match first asks to rephrase
- A second weak match hands off
- Asking for a person wins over everything
- A used-up budget beats a weak match
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.