Skip to content

Instantly share code, notes, and snippets.

@jackdh
Last active August 29, 2015 13:56
Show Gist options
  • Save jackdh/8940057 to your computer and use it in GitHub Desktop.
Save jackdh/8940057 to your computer and use it in GitHub Desktop.
import json
with open('questions.json') as f:
questions = json.load(f)
question_number= questions[0] # 0 For getting first question answer set
print(question_number["question"])
#Prints what is 2+2
@jackdh
Copy link
Author

jackdh commented Feb 11, 2014

Text file,
[
{
"question": "what is 2+2",
"answer": "4",
"fake1": "5"
},
{
"question": "what is the meaning of life?",
"answer": "pizza",
"fake1": "42"
}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment