Python gives me last value of list when I ask it to give the the value at -1 : <p>I am on python 3.7.1.</p>

<p>I am working with data structures, and when using lists, I ran into a bug.
When I try to access index -1, python gives me the last entry in the list.</p>

<p>I opened python shell, and ran the following commands:</p>

<pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; l = [0,1,2]
&gt;&gt;&gt; l[-1]
2
&gt;&gt;&gt; l[3]
Traceback (most recent call last):
  File "&lt;pyshell#5&gt;", line 1, in &lt;module&gt;
    l[3]
IndexError: list index out of range
</code></pre>

<p>This is probably due to a bug on python 3.7.1, but is there a way other than updating python that fixes this? I'm in the middle of a project.</p>
