Diamond star problem

In the diamond star problem:
*
**
















**
*
what does line=line[: -1] mean in the last line of the code?

line=line[:-1] in the last line omits the last character of string as the range is from[:-1](-1 is exclusive) which will neglect the character at the last index ie at index position -1(Index of the last character is -1).