
Bradley T. answered 02/02/23
Tutor for Python and High School and Middle School Math
Slicing works by using the square brackets after a list,string,etc
If you want a specific element, you only give it the index, no colons. In this case, you want a range, so you use the colons. Within a square bracket, the number before the first colon is the start index and includes this index. If you don't include a number it defaults to the beginning of the list. The number after the first colon is the end index, and does not include it. In your case, you want up until but not including the 4th index in the list, that is elements of index 0,1,2,3.