title: Constructing a parametrized sql query with variable number of args
body: <p>Using MySQLDB, I am able to do database operations. But, I got stuck at one point where I need to construct a query having a <code>where objectid in (variable no. of args)</code> condition.<br>
  Since args are variable, I am unable to construct a query having matching number of <code>%s</code>.<br>
  Normally, I do this for a query like below:</p>
  
  <pre><code>select * from table where objectid in (args1, args2, args3, args4)
  </code></pre>
  
  <p>For query above, I would go like this and pass the relevant tuple having 4 members:</p>
  
  <pre><code>select * from table where objectid in (%s, %s, %s, %s) 
  </code></pre>
  
  <p>But, for a query like below, how do I match the number of <code>%s</code> for variable number of args:  </p>
  
  <pre><code>select * from table where objectid in (args1, args2, args3, args4...)
  </code></pre>
  
  <p>Only thing I could think of doing is to create a tuple having as many number of <code>%s</code> as the args, in a for loop and then add it using string concatenation. Would this method be a wrong choice?</p>