cut off last 2 letters of a string python code example Example: python remove last 4 characters from string foo = foo[:-n]