Whitespace includes all Unicode whitespace characters, such as spaces, tabs (\t), carriage returns (\r), and newlines (\n). The Python str() class has the following methods that you can use to trim whitespace from a string:
strip([chars]): Trims characters from both ends of a string. When chars is omitted or None, returns a new string with all leading and trailing whitespace removed.
rstrip([chars]): Trims characters from the right side of a string. When chars is omitted or None, returns a new string with all trailing whitespace removed.
lstrip([chars]): Trims characters from the left side of a string. When chars is omitted or None, returns a new string with all leading whitespace removed.