How do I go about deleting specific sub keys ( and underlying key/pairs )from a dictionary.
For example:
{
"Key A": {
"1": {
"question": "question",
"answer": "answer"
},
"Key B": {
"1": {
"question": "question",
"answer": "answer"
}
},
"Key C": {
"1": {
"question": "question",
"answer": "answer"
},
"2": {
"ActualQuestion": "What .. this?",
"Answer": "New Question...swer"
}
}
}
Let's say I want to delete rec "1" the Key C:
"1": {
"question": "question",
"answer": "answer"
},
I thought maybe :
var question_group = data["Key C"]
question_group.erase("1")
but this doesn't seem to work. I don't need to iterate through the dictionary, I want to pull up that record and then have the option to delete it.
Thanks in advance