List Range Refinement
<p>I have been using the <code>a[0:2]</code> format for ranges but it has been bothering me that if I have <code>a = range(0, 5)</code> I get <code>a[0, 1, 2, 3, 4]</code> but if I use <code>a[0:-1]</code> I get <code>a[0, 1, 2, 3]</code>.  </p>

<p>I know if I use <code>a[0:]</code> I get the full range, but if I want to have the end of the range defined by a variable (example: <code>c = -1</code> then <code>a[0,c]</code>) there is no way for me to get the full range without using a conditional statement (for instance: <code>if c == -1: c = None</code>).  </p>

<p>Is there some nice format that I could use to be able to access the whole range while using variables as the limits?  Or am I stuck needing a conditional statement?</p>

<p>Thanks.</p>

<p>Edit:  It appears I have two options available, I can either set the variable to <code>None</code> conditionally or I can set the variable so that the last term is set at <code>len(a)</code>.  I am not 100% sure which way I am going to go with yet, but thank you all for your responses.</p>
