The slice operator [n:m] returns the part of the string from the nβth character to the mβth character, including the first but excluding the last. In other words, start with the character at index n and go up to but do not include the character at index m.
If you omit the first index (before the colon), the slice starts at the beginning of the string. If you omit the second index, the slice goes to the end of the string.