Python - Array goes out of bounds
<p>Good day everyone,</p>

<p>today I struggled with my code for more than an hour, just to find out that Python did not give an out of bound error.
This is my summarised code:</p>

<pre><code>array = []
n = 0
while n &lt; 5:
    array.append(1)
    n = n + 1
print array
for i in range(0,1):
    print i-2
    print array[i-2]
</code></pre>

<p>Clearly array[i-2] is out of bound, but the code still runs. This is the output:</p>

<pre><code>[1, 1, 1, 1, 1]
-2
1
</code></pre>

<p>Am I missing something, is it my PC or is it something more in depth on how arrays in Python work?</p>

<p>Greetings</p>