Skip to main content

An app to quiz the user on trivia

Project description

Poetry

GH Actions

Black

pre-commit

pre-commit

Quiz Game

A simple command-line quiz game.

This script reads questions from a TOML file, allows the user to choose a topic, and quizzes the user with a set number of random questions from that topic.

Requirements

  • Python 3.7 or later
  • The tomllib library for TOML parsing

Install tomllib with:

pip install toml

Usage

  1. Clone the repo
git clone https://github.com/robert-portelli/quiz
  1. Navigate to the project directory
cd quiz
  1. Run the quiz
python quiz.py

How to Play

The script will prompt you to choose a topic from the available options. You will then be asked a set number of random questions from the chosen topic. Answer the questions as prompted. Your performance will be displayed at the end of the quiz.

Questions File

Questions are stored in a TOML file (QUESTIONS.toml). You can customize this file by adding your own questions and topics.

Example structure:

[topic_name]
label = "Topic Name"

[[topic_name.questions]]
questions = "What is the capital of France?",
answers = ["Paris"],
alternatives = ["London", "Berlin"],
explanation = "Paris is the capital of France."

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

squaz-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squaz-0.1.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file squaz-0.1.2.tar.gz.

File metadata

  • Download URL: squaz-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.4 Linux/6.2.0-36-generic

File hashes

Hashes for squaz-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9f3dc223d66f2746b94b6dfafcc15f4cc8216ad0b2ef59a8ba3c8a17c0e9872
MD5 65495b59852cfc818df7c43c8f1d5b9e
BLAKE2b-256 a831507b0e7e9efa0ee6ea1a032aaef4fae76235d209d189d42242c8c6a03825

See more details on using hashes here.

File details

Details for the file squaz-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: squaz-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.4 Linux/6.2.0-36-generic

File hashes

Hashes for squaz-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76e94f4623ae418c2d050f888ff2a2a5a19942da619a8fe53ac3189cccb219cf
MD5 6ba8cb0f688ec98de954a2e89331a8ff
BLAKE2b-256 55406875a0936a6f4ed815bec70806f332cf175e691b3ead24fceecb28ba95e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page