Stripping Whitespace: strip(), rstrip(), lstrip() in Python


Remove whitespace from the beginning, end, or both sides of a string.

Source Code

user_input = "   Python   "
print(user_input.strip())
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments