Created
July 19, 2020 09:08
-
-
Save raeq/9f8266b64ff6af2d3d493c99228de66a to your computer and use it in GitHub Desktop.
Returns a tuple of string stripped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def strip_it(input_string: str) -> tuple: | |
return (input_string.lstrip(), input_string.rstrip(), input_string.strip()) | |
left, right, full = strip_it(" A padded string ") | |
assert left == "A padded string " | |
assert right == " A padded string" | |
assert full == "A padded string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment