I want to store the unanswered question of user and categorize them into different classes, the unanswered question will be saved in a excel file.
You can create a dictionary of lists with the categories
categories = {
"price": [],
"size": [],
.
.
.
}
Then go through each categories.keys() and search each key in each question and then append to the list.
for q in questions: #list of questions
for k in categories.keys():
if k in q:
categories[k].append(q)
It will give you a dictionary of categorised questions. But questions can be repeated in several categories, be careful. (you can pop those questions out)