+ 2
type error: can't use - for list or integer
what i can do for this code? https://code.sololearn.com/cpj40S46B1WC/?ref=app
5 ответов
+ 3
https://docs.python.org/3/library/sqlite3.html
Yes execute(SELECT) returns a list, even though by fixing id as 1 there is only one entry.
+ 4
it turns out that select produces list of dictionaries. so
a =a[i] ["key"]
and its worked, thank you all.
Gordon Maninder $ingh thank you very much
+ 2
I think when you define c variable then something is wrong please check your code again.
+ 2
print(type(a))
If a is list
Use a[0] to get the number first, then type cast to float
+ 1
a = float(a)
c = float(c)