Q:

Why does this print out spospo?

>>> print("loops"[- 1:1:- 1]*2)
spospo
>>>

Why wouldn't the output be slssls?

A:

"loops"[-1:1:-1]

Let’s check how slicing works:

s[i:j:k] – slice of s from i to j with step k
If i or j is negative, the index is relative to the end of the string: len(s) + i or len(s) + j is substituted. But note that -0 is still 0.
The slice of s from i to j with step k is defined as the sequence of items with index x = i + n*k such that 0 <= n < (j-i)/k. In other words, the indices are i, i+k, i+2*k, i+3*k and so on, stopping when j is reached (but never including j). If i or j is greater than len(s), use len(s). If i or j are omitted or None, they become “end” values (which end depends on the sign of k). Note, k cannot be zero. If k is None, it is treated like 1.

So [-1:1:-1] means i = -1, j = 1, k = -1.
i is negative, so i = -1 means that i = len(s) + (-1) = len(s) - 1. len(s) is 5, so we get the following slice: "loops"[4:1:-1].
As per above definition, we now the the items with the following indexes: 4, 4 - 1 = 3, 4 - 2 = 2. We stop at 4 - 3 = 1 because that is our end, and we don’t include that.
So the result are indexes 4, 3, 2, which is 'spo'.
Finally, that string is multiplied by 2 which repeats it once: 'spospo'.

