If we have a list a = [1,2,3,4]
and list b = [5,6,7]
why is a[1]
interpreted differently than a[1:1]
and what exactly is the difference?
If I want to add all of list b
to list a
at index 1
, so that the list a
becomes [1,5,6,7,2,3,4]
why do I have to run a[1:1] = b
instead of a[1] = b
?
how exactly is a[1:1]
interpreted?