This is my code
keys = {"setup", "punchline"}
l = [{k:v for k, v in i.items() if k in keys} for i in response_dict]
print(json.dumps(l, indent=4, sort_keys=False))
{
"setup": "What's the best part about TCP jokes?",
"punchline": "I get to keep telling them until you get them."
},
{
"setup": "How many programmers does it take to change a lightbulb?",
"punchline": "None that's a hardware problem"
},
{
"setup": "What's the best thing about a Boolean?",
"punchline": "Even if you're wrong, you're only off by a bit."
Deisred output
setup: What's the best part about TCP jokes?
punchline: I get to keep telling them until you get them.