Goals: what you will make by the end of the day (2)
Open Trivia DB
- Using TRIVIA API that we have learned on Day17 to build up Quiz App by TKinter
- Using API to populate questions in our quiz

Trivia Question API Challenge (6)
-
Modify the data.py file (don’t change the main.py)
-
Make a get() request to fetch 10 True or False questions.
-
Parse the JSON response and replace the value of question_data (don’t change the variable name)
-
Hint: create a Python dictionary for the amount and type parameters.
Solution & Walkthrough for getting Trivia Questions (4)
import requests
URL = "<https://opentdb.com/api.php?amount=10&category=18&difficulty=medium&type=boolean>"
response = requests.get(URL)
response.raise_for_status
data = response.json()
#print(data["results"])
question_data = data["results"]
Unescaping HTML Entitles (4)
- There is a way to replace HTML characters so it will not be displayed in question list.
- HTML Entities
HTML Entities