Back to All Challenges
Back to all challenges

The 30-Day Refund Loophole

Solve the "The 30-Day Refund Loophole" advanced challenge. Focus: python logic.

advancedpython

Terminal

user@debugger:~/project$ node app.js
Silent logic error: Purchases older than 30 days with a valid receipt are incorrectly approved for refund (e.g., 45 days old returns True instead of False). Due to operator precedence, the condition is evaluated as `(days <= 30 and defective) or (receipt and not final)` instead of `days <= 30 and (defective or receipt) and not final`, so the 30-day check is bypassed when a receipt is present.
user@debugger:~/project$
Test Cases (Click to expand)