sqlite3 is giving me (type,) instead of "type"

Question:

My Sqlite3 database is giving me (type,) instead of "type" when I’m trying to print something in the database (note that the "type" thing is from the database)

here’s my code :

    c.execute("SELECT type FROM accounts")
    acctype = c.fetchall()
    print(acctype[0])

the output is (type,)

Asked By: SIDALonpy

||

Answers:

acctype is a list of tuples so:

print(acctype[0][0])
Answered By: PChemGuy
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.