I'm learning Python and have a basic grasp of the way Slice works, but there's a particular block of code that I'm having trouble grasping:
L = [2,4,6,8,0]
L[0:3] = [2,4,6,8]
print L[4]
The output of this is 8, which I find strange; I'd expect it to still be 0 as I read the second line as "transform the first 4 elements of the list into 2,4,6,8." This would still leave a list of [2,4,6,8,0], which is obviously not happening. I'd be grateful if anyone could explain why Slice is behaving this way!
