title: How do I group list of numbers using some range in python?
body: <p>I have a list of numbers and I want to group them based on some range. Let's say 1000. Instead of grouping every consecutive number, I want to group all numbers that are within range of 1000 of one another.</p>
  
  <p>For example,        </p>
  
  <pre><code>Data=[900,1050,1900,2100,9000,10000]
  </code></pre>
  
  <p>The output which I require is:    </p>
  
  <pre><code>[(900,1050,1900),(1900,2100),(9000,10000)]
  </code></pre>