concept empty string in category python

This is an excerpt from Manning's book Get Programming: Learn to code with Python.
Suppose you’re reading student essays and you’ve imposed a 2,000-character limit. How can you determine the number of characters a student used? You can set up the entire essay inside a string and then use command, len(), to get the number of characters in the string. This includes all characters between the quotation marks, including spaces and symbols. The empty string has a length of 0. For example,
Because each line you read in is a string, you can use a string method on it. The easiest thing to do is to replace every occurrence of \n with the empty string “”. This will effectively remove the newline character.
The following listing shows how to replace a newline character with an empty string and save the result into a variable.
word = word.replace("\n", "") word = word.strip("\n")