I am trying to add a list of values into a table in a database
QuestionAnswer = [['x','y','z'],['x','y','z']]
(cursor.executemany('INSERT question (QuizID,question,answer) VALUES (%s,%s,%s)',QuestionAnswer)
db.commit()
the error is the following:
Traceback (most recent call last): File "C:\Users\georgia vost\AppData\Local\Programs\Python\Python37-32\lib\tkinter__init__.py", line 1705, in call return self.func(*args) File "C:\Users\georgia vost\Documents\Private Document\NEA WORK\Code Folder\appJar\appjar.py", line 3494, in return lambda *args: funcName(param) File "C:\Users\georgia vost\Documents\Private Document\NEA WORK\Code Folder\prastice program 1.py", line 37, in press cursor.executemany('INSERT question (QuizID,question,answer) VALUES (%s,%s,%s)',QuestionAnswer) File "C:\Users\georgia vost\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\cursor.py", line 675, in executemany self.execute(operation, params) File "C:\Users\georgia vost\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\cursor.py", line 557, in execute psub = _ParamSubstitutor(self._process_params(params)) File "C:\Users\georgia vost\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mysql\connector\cursor.py", line 437, in _process_params "Failed processing format-parameters; %s" % err) mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python 'method' cannot be converted to a MySQL type