title: SQLite3 - Inserting list items in table
body: <p>I'm using python 3.5 and am trying to insert list elements into a table.</p>
  
  <p>The lists are already defined:</p>
  
  <pre><code>list1 = [1,2,3...]
  list2 = [1,2,3...]
  list3 = [1,2,3...]
  list4 = [1,2,3...]
  list5 = [1,2,3...]
  </code></pre>
  
  <p>Connecting to the database :</p>
  
  <pre><code>conn = sqlite3.connect('database.db')
  c = conn.cursor()
  </code></pre>
  
  <p>Create a table, Table1, with 5 columns:</p>
  
  <pre><code>def create_table():
       c.execute("CREATE TABLE IF NOT EXISTS Table1(Column1 TEXT, Column2 TEXT, Column3 TEXT,
  Column4 TEXT, Column5 TEXT)")
  </code></pre>
  
  <p>And adding the list elements to the table:</p>
  
  <pre><code>def data_entry():
      Column1 = list1
      Column2 = list2
      Column3 = list3
      Column4 = list4
      Column5 = list5
      c.execute("INSERT INTO Master (Column1, Column2, Column3, Column4, Column5)
  VALUES (?, ?, ?, ?, ?)", (Column1, Column2, Column3, Column4, Column5))
      conn.commit()
  
  c.close()
  conn.close()
  </code></pre>
  
  <p>When I run it, I get:</p>
  
  <p>ProgrammingError: Incorrect number of bindings supplied. The current statement uses 5, and there are 150 supplied.</p>
  
  <p>Would a loop be more appropriate to use to insert each item list as a new row in the specified column? If so, how do I create a loop for sqlite3?</p>
  
  <p>It's the first time I'm using sqlite3, so any suggestions are much appreciated. Thank you!</p>