how to slice the string minus the last 3 letters in python code example Example: python remove last 4 characters from string foo = foo[:-n]