Skip to content

mrdeephang/CS50-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quiz Game 🎯

A simple, customizable command-line quiz application built with Python.

About

This project was created as my final submission for CS50's Introduction to Programming with Python. It's an interactive quiz game that lets you test your knowledge across different categories, with the flexibility to add your own questions.

Features

  • 📚 Multiple categories of questions
  • ➕ Add custom questions and categories
  • 🎲 Randomized question order
  • 📊 Real-time score tracking
  • 💾 Persistent storage with JSON

Project Structure

quiz-game/
│
├── quiz.py              # Main application
├── questions.json       # Question database
├── test_project.py      # Unit tests
├── requirements.txt     # Dependencies
└── README.md           # Documentation

Getting Started

Prerequisites

  • Python 3.x (no external libraries required)

Installation

  1. Clone or download this repository
  2. Navigate to the project directory:
cd quiz-game

Running the Game

python quiz.py

Running Tests

pytest test_project.py

How It Works

The game presents you with a simple menu:

  1. Play Quiz - Select a category and answer multiple-choice questions
  2. Add Question - Contribute your own questions to the database
  3. Exit - Close the application

Questions are stored in questions.json and organized by category. Your score is calculated and displayed at the end of each quiz session.

Customization

You can easily expand the quiz by:

  • Adding questions through the built-in menu
  • Manually editing questions.json to add categories or questions
  • Modifying the game logic in quiz.py

Technologies Used

  • Python standard library
  • JSON for data persistence
  • pytest for testing

License

© 2025 Deephang Thegim. All rights reserved.

This project is for educational purposes as part of CS50's Introduction to Programming with Python.

Usage Terms:

  • ✅ Free to use and modify with attribution
  • ✅ Educational and personal use

Acknowledgments

Created as part of CS50's Introduction to Programming with Python

About

Quiz Game - A command-line quiz app with multiple categories, custom questions, and score tracking. CS50 Python final project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages