1👍
✅
Your problem is that you’re passing more arguments to execute
than it accepts. What you need is to combine the query’s parameters into a single tuple. One way to do that is to use itertools.chain
to chain both lists’ elements into one iterable that can be used to create a single tuple:
import itertools
cursor.execute(query, tuple(itertools.chain(codes, orgs)))
Source:stackexchange.com