The strip() method removes whitespace or specified characters from both the beginning and end of a string, lstrip() removes them only from the beginning, and rstrip() removes them only from the end.