title: Create Python string placeholder (%s) n times
body: <p>I am looking to automatically generate the following string in Python 2.7 using a loop based on the number of columns in a Pandas DataFrame:</p>
  
  <pre><code>INSERT INTO table_name (firstname, lastname) VALUES (534737, 100.115)
  </code></pre>
  
  <p>This assumes that the DataFrame has 2 columns.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code># Generate test numbers for table:
  df = pd.DataFrame(np.random.rand(5,2), columns=['firstname','lastname'])
  
  # Create list of tuples from numbers in each row of DataFrame:
  list_of_tuples = [tuple(x) for x in df.values]
  </code></pre>
  
  <p>Now, I create the string:
  Manually - this works:</p>
  
  <pre><code>add_SQL = INSERT INTO table_name (firstname, lastname) VALUES %s" % (list_of_tuples[4])
  </code></pre>
  
  <p>In this example, I only used 2 column names - <code>'firstname'</code> and <code>'lastname'</code>. But I must do this with a loop since I have 156 column names - I cannot do this manually.</p>
  
  <p>What I need:</p>
  
  <ol>
  <li>I need to automatically generate the placeholder <code>%s</code> the same
  number of times as the number of columns in the Pandas DataFrame.
  Here, the DataFrame has 2 columns so I need an automatic way to
  generate <code>%s</code> twice.</li>
  <li>Then I need to create a tuple with 2 entries,
  without the <code>''</code>.</li>
  </ol>
  
  <p>My attempt:</p>
  
  <pre><code>sss = ['%s' for x in range(0,len(list(df)))]
  add_SQL = "INSERT INTO table_name (" + sss + ") VALUES %s" % (len(df), list_of_tuples[4])
  </code></pre>
  
  <p>But this is not working.</p>
  
  <p>Is there a way for me to generate this string automatically?</p>