remove last 3 letters from string python code example Example: python remove last 4 characters from string foo = foo[:-n]