Skip to content

Instantly share code, notes, and snippets.

@crodriguez1a
Last active June 24, 2019 17:20
Show Gist options
  • Save crodriguez1a/580cf9b5b43430ad6af03736b8b07b6d to your computer and use it in GitHub Desktop.
Save crodriguez1a/580cf9b5b43430ad6af03736b8b07b6d to your computer and use it in GitHub Desktop.
Intermediate Python Quiz
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