In, Python String.strip() with no arguments removes all whitespace at the start and end, including spaces, tabs, newlines and carriage returns.
For example, by using .strip(), the following two lines in a file would lead to the same end result:
foo\tbar \n foo\tbar\n
To know more about this you can have a look at the following video tutorial:-