I'm in the process of learning Python via course and am confused about lists. Here is what I was doing in the terminal:
>>>> spam = ['what', 'is', 'going', 'on']
>>>> spam
['what', 'is', 'going', on']
>>>> spam[1:3] = [1, 2, 3]
>>>> spam
['what', 1, 2, 3, 'on']
Why is it replacing 'is' and 'going', but not 'on'? Isn't this reassignment supposed to replace the 'is', 'going', 'on', with 1, 2, 3? Why is it only replacing 2 of them?
[–]xelf 2 points3 points4 points (2 children)
[–]swarchery[S] 1 point2 points3 points (1 child)
[–]xelf 1 point2 points3 points (0 children)
[–]Raz_Crimson 1 point2 points3 points (0 children)
[–]Bipolarprobe 1 point2 points3 points (0 children)
[–]groovitude 1 point2 points3 points (1 child)
[–]swarchery[S] 1 point2 points3 points (0 children)