Good day everyone,
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:
array = []
n = 0
while n < 5:
array.append(1)
n = n + 1
print array
for i in range(0,1):
print i-2
print array[i-2]
Clearly array[i-2] is out of bound, but the code still runs. This is the output:
[1, 1, 1, 1, 1]
-2
1
Am I missing something, is it my PC or is it something more in depth on how arrays in Python work?
Greetings