Created
August 7, 2018 07:53
-
-
Save djokester/7f9168aad9480fccb1b8c25e1091e0a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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