this too removes the last character in the string
alphabets = 'abcdefgh' print(alphabets[:-1])
the[:-1] slices the last character specified in the -1. hence the output is abcdefg. slicing h