Skip to content

Instantly share code, notes, and snippets.

@djokester
Created August 7, 2018 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djokester/7f9168aad9480fccb1b8c25e1091e0a9 to your computer and use it in GitHub Desktop.
Save djokester/7f9168aad9480fccb1b8c25e1091e0a9 to your computer and use it in GitHub Desktop.
#Assigning question to topics.
question_list = []
final_topic_list = []
for topic in topic_list:
temp = []
for question in questions:
context = [i["name"] for i in question["topics"]]
if topic in context:
temp.append(question['question_text'])
if len(temp) >= 5:
question_list.append(temp)
final_topic_list.append(topic)
topic_list = final_topic_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment