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