Skip to content

Instantly share code, notes, and snippets.

@Linus-Albertus
Last active May 26, 2019 10:57
Show Gist options
  • Save Linus-Albertus/6ebce22bca6d5c2a8337478964434fab to your computer and use it in GitHub Desktop.
Save Linus-Albertus/6ebce22bca6d5c2a8337478964434fab to your computer and use it in GitHub Desktop.
[reverse phrase] Take a phrase and reverse it
original_phrase = 'foo bar'
reversed_list = [word for word in reversed(original_phrase.split())]
reversed_phrase = ' '.join(reversed_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment