title: SQLite dynamically insert multiple values
body: <p>I have a python web scraper that scrapes an apartment website and compiles various pieces of information about each property. I'm trying to use SQLite to dynamically insert each variable from the scraper to the SQLite DB. So Far I have written this code and it successfully inserts 1 row. For this to work I need it to insert all the rows. Could this be solved with a for loop?</p>
  
  <p>'''</p>
  
  <pre><code>conn = sqlite3.connect('RentScraper.db')
  c = conn.cursor()
  
  def create_table():
  # Create table
      c.execute("""CREATE TABLE IF NOT EXISTS property (\
              property_name varchar (250) NOT NULL,\
              street_address varchar (20) NOT NULL,\
              rent_price varchar (20) NULL,\
              available_units INT NULL,\
              contact_number varchar(50) NULL,\
              PRIMARY KEY (property_name))""")
  
  
  def dynamic_data_entry():
      c.execute("INSERT INTO property (property_name, street_address, rent_price, available_units, contact_number) VALUES (?, ?, ?, ?, ?)",
              (name, city, price, units_avl, contact))
      conn.commit()
  
  
  create_table()
  dynamic_data_entry()
  </code></pre>
  
  <p>'''</p>
  
  <p><a href="https://i.stack.imgur.com/mVsKk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mVsKk.jpg" alt="SQLite code"></a></p>