In python I have fetchall data from the database.
SENTENCE = "It is wonderful. I'am happy"
sent= (word_tokenize(SENTENCE))
cursor = conn.cursor()
format_strings = ','.join(['%s'] * len(sent))
cursor.execute("SELECT emotion_type FROM emotion WHERE key_word IN (%s)" % format_strings,tuple(sent))
results = cursor.fetchall()
for i in results:
z= (i)
The output is
('happy',)
('happy',)
But I want to get this result as
['happy','happy']
If there is any possible way to get output as I want. Please help me !