Welcome to the Trivia Quiz (with APIs) page.
This page contains a brief description and implementation instructions for the project.
Project Description
A trivia quiz that fetches questions from an online API (e.g. Open Trivia DB). Presents questions and choices to the user in the terminal.
Project Requirements
Python 3.x, requests
library.
How to Run the Project
- Write a script (e.g.
trivia.py
) usingrequests
to call a trivia API and retrieve questions in JSON. - Run it:
python trivia.py
. It displays questions and collects answers, then shows score.
Key Concepts Learned
- API Integration: Consuming a real trivia web service.
- JSON Handling: Parsing questions and answers.
- User Interaction: Displaying multiple-choice format.
Possible Extensions
- Support categories or difficulty levels.
- Save high scores.
- Build a web or GUI version.