How come this code does not throw an error when run by the Python interpreter.
a = ['A', 'B', 'C']
a[20:] = ['D', 'E']
print a
Output is ['A', 'B', 'C', 'D', 'E']
. I thought Python would give me an error on the second statement since a
has only 3 elements. Does this feature have any natural uses while coding?