Beginner
Check the model's total
A model writes order confirmations like "Your total is Rs 1,159.00.". Write claimed_total(reply) that returns the amount after "Rs " as a float (remove the thousands commas and a final full stop). Return None if the reply has no "Rs ".
Write total_ok(reply, items) where items is a list of (name, qty, price). Return True only if the claimed total is within 0.005 of the real total.
What Check tests
claimed_totalreadsRs 1,159.00.as 1159.0claimed_totalreturns None withoutRs- A correct total passes
- A wrong total fails
- A reply with no amount fails safely
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.