I get object is not subscriptable on a non empty query result. When i print
c.fetchone() it prints the correct result but when i check the type it says <class 'NoneType'>
import sqlite3
conn = sqlite3.connect("scraping.db")
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS Terminate (numar INT, arj INT )')
conn.commit()
c.execute('DELETE FROM Terminate')
conn.commit()
c.execute('INSERT OR IGNORE INTO Terminate ( numar, arj ) VALUES (1,0)')
conn.commit()
c.execute("SELECT * FROM Terminate") # ORDER BY numar DESC LIMIT 1")
print(c.fetchone(), type(c.fetchone()))
ins = c.fetchone()[0]
result = c.fetchone()res = c.fetchone()thenprint(res, type(res))will work as you expectresult = c.fetchone()ins = result[0] TypeError: 'NoneType' object is not subscriptablec.fetchone()once