title: sqlite3 "OperationalError: near "(": syntax error" python
body: <p>simply put i am trying to make a sql database table and input data into it. I have it working in a simpler way, but when I put it into my script it results in this error. I'm hoping its something simple I missed. Any help/advice would be greatly appreciated.    </p>
  
  <pre><code>conn = sqlite3.connect('Data1.db')
  
  c = conn.cursor()
  
  # Create table
  c.execute('''CREATE TABLE Data_Output6
           (date text, output6MV real)''') 
  
  Averages_norm = []
  
  for i, x in enumerate(Averages):
      Averages_norm.append(x*output_factor)
      c.execute("INSERT INTO Data_Output6 VALUES (%r,%r)" %(xdates[i],Averages_norm[-1]))
  conn.commit()
  </code></pre>
  
  <p>results in the error:</p>
  
  <pre><code>57     for i, x in enumerate(Averages):
  58         Averages_norm.append(x*output_factor)
  ---&gt; 59         c.execute("INSERT INTO Data_Output6 VALUES (%r,%r)"%(xdates[i],Averages_norm[-1]))
  60     conn.commit()
  61 
  </code></pre>
  
  <p>OperationalError: near "(": syntax error</p>