I am using below code for adding an element in array but it is giving me below error while running it
cars = ["Ford", "Volvo", "BMW"]
cars.append("Honda")
cars[4] = "BMWq";
for x in cars:
print(x)
Output error
List assignment index out of range
Not able to understand reason of this error