Why is recordset result being returned in this way for Python database query?
list, mysql, python, recordset
Solution
It's returning it in that way because a recordset is comprised of many rows of data, not a list of single elements.
You can flatten it if you want using a list comprehension:
data = [row[0] for row in cursor.fetchall()]
Problem
I have searched high and low for an answer to why query results returned in this format and how to convert to a list. data = cursor.fetchall() When I print data, it results in: (('car',), ('boat',), ('plane',), ('truck',)) I want to have the results in a list as ["car", "boat", "plane", "truck"]