title: How to find all the possible combinations of a range in Python?
body: <p>This is more of a math question than Python, but if I have a range 0-100, how would I go about iterating through all the possible ranges in this? For example, the lower bound could be 0, and then the upper could be anything from 1-100 and so on.</p>
  <p>Would something like this cover all possibilities?</p>
  <pre><code>lower = 0
  upper = 100
  for i in range(0,100):
      for z in range(lower,upper):
         print(&quot;Range is&quot; + str(z) +&quot;:&quot; + str(upper))
      
      lower = lower +1
      upper = upper -1
  </code></pre>