You are viewing a single comment's thread. Return to all comments →
the purpose of the strip command is to remove white spaces.. for example:
print " hello world "
there are white spaces by the sides of hello world... but if you use the split command,
print (" hello world ").split()
it removes the white spaces at the beginning and the end.
also if you want to remove the white space the left, use .lstrip() and if its the right only, use .rstrip()...DO you understand it now ?
Python If-Else
You are viewing a single comment's thread. Return to all comments →
the purpose of the strip command is to remove white spaces.. for example:
there are white spaces by the sides of hello world... but if you use the split command,
it removes the white spaces at the beginning and the end.
also if you want to remove the white space the left, use .lstrip() and if its the right only, use .rstrip()...DO you understand it now ?