Theory ofIntelligence
← PRACTICE/
Hard
Python• OOP

Online Shopping Cart with Discounts

Create a Product hierarchy, a ShoppingCart, and discount strategies (percentage discounts, buy-one-get-one).

Use composition and the strategy pattern so new discount rules can be added without rewriting the cart logic.

OOP Focus: Design patterns basics.

Note: This is statement-only in the current Practice version; stdout should be empty.

Sample Test Verification
1 Test Case
Statement & Architecture VerificationThis drill validates class blueprints, object attributes, and method state transitions without requiring console printing.
solution.py
Initializing Monaco Python Environment...
Input (stdin)
(empty string)
Expected Output (stdout)
(no output expected)