title: python how to make range include end boundary
body: <p>I am trying to make <code>range</code> include end boundary, </p>
  
  <pre><code>if distance == 1:
       end_boundary = int(d + distance + distance)
  else:
       end_boundary = int(d + distance + distance - 1)
  
  for y in range(int(d - distance), end_boundary):
      # some other code
  </code></pre>
  
  <p><code>d</code> contains <code>int</code> value, I am wondering if there is a better way to do this.</p>
  
  <p>Also I want to make this code work when <code>d</code> and <code>distance</code> contains <code>float</code> values.</p>