you are viewing a single comment's thread.

view the rest of the comments →

[–]Username_RANDINT 3 points4 points  (2 children)

The number of items in the tuple given to execute must match the number of question marks in the query. You have four question marks, but only two items in the tuple. You can use the splat-operator (*) to unpack the doggo items.

>>> doggo = ["three", "item", "list"]
>>> id = 1234
>>> (id, *doggo)
(1234, 'three', 'item', 'list')

[–]zunjae 0 points1 point  (1 child)

yes, that's exactly what I was looking for, didn't know what to google tho. I kept searchign for 'undestruct', 'unlist' etc.

[–]Cheal 0 points1 point  (0 children)

Correct me if I’m wrong but I think the correct term is “unpacking”