title: Gurobi/Python: Adding Binary Variables through addVars
body: <p>I have these sets:</p>
  <pre><code>R = [1,2,3,4]
  C = [10,11,12,13,14,15,16,17,18,19,20,21]
  Cr = {1: C[0:3], 2 : C[3:6],3: C[6:9], 4: C[9:12] }
  </code></pre>
  <p>I want to write a code for adding the next variable shown in the image
  <a href="https://i.stack.imgur.com/Stuqt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Stuqt.png" alt="z variable" /></a></p>
  <p>My trial is as next</p>
  <pre><code>z = m.addVars(R,Cr[r] for r in R,Cr[r] for r in R,vtype=GRB.BINARY)
  </code></pre>
  <p>When I tried to print z, I got this error: Generator expression must be parenthesized</p>