Hello I am trying to access the values in a dict that I will load from a json file. This is all from a function that I made where the variable subject takes in the input of the subject the user wants to study and creates the key for it if it doesn't exist. I did the same thing for the variable chapter and it's value is a list of tuples that has the variable question and answer.
{
"Sec+": {
"Chapter 1": [
[
"What is a VPN?",
"Virtual Private Network"
],
[
"What is an IDS?",
"Intrusion Detection System"
]
],
"Chapter 2": [
[
"What is a WAN?",
"Wide Area Network"
],
[
"What is a DNS?",
"Domain Name Services"
]
]
},
"Python": {
"Chapter 1": [
[
"What statement creates a function",
"A def statement"
],
[
"What happens to variables in a local scope when the function call returns?",
"They get destroyed/forgotten"
]
]
}
}```
This is my attempt to display the values of the dict
```py
def quizTaker():
with open("practiceQuiz.json", "r") as json_QAfile:
pracQA_Data = json.load(json_QAfile)
print("What subject would you like to study?")
print(", ".join(pracQA_Data.keys()))
userInputSubject = input()
if userInputSubject in pracQA_Data.keys():
print(", ".join(pracQA_Data[subject][chapter]))
print("What chapter would you like to study (or type random)")
userInputChapter = input()
quizTaker() ```
I