Project Brief
Let’s start the week by practicing data structures. Take a minute to look at these JSON data. Here is an excerpt of the data:
{
"quizzes": [
{
"quizTitle": "World Quiz",
"questions": [
{
"id": 1,
"question": "What is the capital of France?",
"choices": {
"Paris": true,
"London": false,
"Berlin": false,
"Madrid": false
}
},
{
"id": 2,
Create a Python program that asks the user to enter the ID of a question in the command line. Then, the program returns the correct answer for that question.
Expected Output
Here is an example of how the program would behave:
Environment Setup Instructions
You don’t need to install any libraries.
Execute with python main.py and follow the instructions in the command line to use the program.
Resources
Learn how to load JSON data in Python:
https://pythonhow.com/how/load-json-data-in-python/
Project Solution
Feel free to post your questions or comments in the comment section below.
Happy Coding!
Daily Python Projects Team