We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The strip() method returns a copy of the string with both leading and trailing characters removed (based on the string argument passed). The strip() removes characters from both left and right based on the argument (a string specifying the set of characters to be removed).
In simple grammar, if one enters a value or any input and the person mistakenly press spacebar or leaves space, the strip function will clear out those spaces and pick up that character the person inputed only...
so lets say you enter " 5"... the space before the 5 will be removed with the strip function. I don't know if this helps
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Python If-Else
You are viewing a single comment's thread. Return to all comments →
The strip() method returns a copy of the string with both leading and trailing characters removed (based on the string argument passed). The strip() removes characters from both left and right based on the argument (a string specifying the set of characters to be removed).
In simple grammar, if one enters a value or any input and the person mistakenly press spacebar or leaves space, the strip function will clear out those spaces and pick up that character the person inputed only...
so lets say you enter " 5"... the space before the 5 will be removed with the strip function. I don't know if this helps