Created
July 18, 2020 10:38
-
-
Save raeq/88fd2862a9a91cff69b7fc6c97d9414d to your computer and use it in GitHub Desktop.
Reverse a String
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 string_reverse(forward: str = "") -> str: | |
return forward[::-1] | |
assert string_reverse("hello") == "olleh" | |
assert string_reverse("goodbye") != "goodbye" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment