python strip last 4 characters code example Example: python flask how to remove last character from string string="mystring"; string[:-1]