Last active
June 24, 2019 17:20
-
-
Save crodriguez1a/580cf9b5b43430ad6af03736b8b07b6d to your computer and use it in GitHub Desktop.
Intermediate Python Quiz
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 reverse_letters(thing:str) -> str: | |
return thing[::-1] | |
x = reverse_letters("foo bar baz") # => zab rab oof | |
print(x) | |
def reverse_words(str): | |
return " ".join(str.split()[::-1]) | |
y = reverse_words("foo bar baz") # => baz bar foo | |
print(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment