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