title: I am confused about where the r in the below code
body: <p>I am confused about where the <code>r</code> in the below code comes from in the <code>combinations</code> function. A bit new to Python.</p>
  <pre><code>from itertools import chain, combinations
  
  def powerset(iterable):
      &quot;powerset([1,2,3]) --&gt; () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)&quot;
      s = list(iterable)
      return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
  </code></pre>