A Python-based command line project that combines a quiz game with a shopping cart system. Users answer quiz questions to earn a discount, which is applied to their final shopping bill.
- Dynamic Quiz (random questions every time)
- Score-based discount system
- Add multiple items to shopping cart
- Automatic bill calculation
- Discount applied on total bill
- Saves user score and shopping bill in files
- User name tracking
- Python
- Functions
- Lists & Dictionaries
- Loops
- Conditional Statements
- File Handling
- Random Module
- Datetime Module
- User enters their name
- Quiz starts (3 random questions)
- Each correct answer = 10 points
- Based on score:
- 30 → 20% discount
- 20 → 10% discount
- Less than 20 → No discount
- User adds items to cart
- Final bill is calculated with discount
- Bill and score are saved in files
- Make sure Python is installed
- Clone the repository:
git clone https://github.com/yachikadev/quiz-shopping-system-python.git
cd quiz-shopping-system-python- Run the program:
python main.py- score.txt → Stores quiz scores with date & time
- bill.txt → Stores detailed shopping bills
=== QUIZ TIME === Question: ... Correct! === SHOPPING CART === Item Price Quantity Apple 50 2 100 Subtotal: ₹100 Discount (10%): -₹10 Final Bill: ₹90
Yachika Sharma