I am getting syntax error in sql query statement stored in cur to store multiple list value
nam = ['sau','sing','loe','sta']
for d in nam:
cur.execute("""INSERT INTO pages_post (pname) VALUES ({})""", .format(d))
print(len(nam))'
getting error for the following statement
cur.execute("""INSERT INTO pages_post (pname) VALUES ({})""", .format(d))
the erroe message giving is
File "C:\Users\surya\Desktop\whtscric\fe.py", line 12
cur.execute("""INSERT INTO pages_post (pname) VALUES ({})""", .format(d))
^
SyntaxError: invalid syntax
cur.execute.execute- separated by a comma - and the second one is just.format(d), which is not a valid Python expression.