I made a SQLite query in Python like that:
SharesOwned = db.execute("SELECT SUM(Shares) FROM transactionTable WHERE Share='FB'")
print(SharesOwned)
if sharesOwned < sharesToSell:
return errorMessage("You don't own that many shares of FB")
It prints:
[{'SUM(Shares)':10}]
Then it gives me this error:
TypeError: "List indices must be integers or slices not str"
How can I extract the number as an integer?