Python array program not giving correct output : <p>I am using below code for adding an element in array but it is giving me below error while running it</p>

<pre><code>cars = ["Ford", "Volvo", "BMW"] 
cars.append("Honda") 
cars[4] = "BMWq";
for x in cars:
  print(x) 

Output error
</code></pre>

<p>List assignment index out of range</p>

<p>Not able to understand reason of this error</p>
