While reading about slicing in Python I came across this interesting example which doesn't make sense. let a be a list
a = [1,2,3,4,5,6,7]
a[1:4] = [0,0]
print(a)
output>> [1, 0, 0, 5, 6, 7]
a = [1,2,3,4,5,6,7]
a[1:6:2] = [0,0]
ValueError: attempt to assign sequence of size 2 to extended slice of size 3
Why do we get ValueError in the second case? The description says size 2 to extended slice of size 3
but in first case we are assigning the sequence of size 2 to a slice of size 3 and it works.