title: Building ranges using python set-builder notation
body: <p>Hey, I am trying to build a set of ranges in python like so:</p>
  
  <p>Given <code>(0.1, 0.2, 0.7)</code></p>
  
  <p>I want to build <code>[(0, 0.1), (0.1, 0.3), (0.3, 1)]</code></p>
  
  <p>While this could be achieved easily through a regular for-loop, as a learning exercise I wanted to see if this could be achieved via a set-builder expression.</p>
  
  <p>My first thought was to do <code>[(i, i+t) for i = 0, i+=t, t in (0.1, 0.2, 0.7)]</code>, however that is not valid syntax, I tried a few other expressions, however I noticed that it is not possible to assign values to variables inside the expression. Looking for information, it seems that in list-builder expressions you can iterate through various other iterable objects at the same time, but not keep a state.</p>
  
  <p>So I want to know if it is at all possible to do something like this in a "pythonic" way.</p>