Skip to content

Instantly share code, notes, and snippets.

@KHerb
Created May 27, 2016 22:27
Show Gist options
  • Save KHerb/6bb127379f6f3ee123baa7e90dada0c5 to your computer and use it in GitHub Desktop.
Save KHerb/6bb127379f6f3ee123baa7e90dada0c5 to your computer and use it in GitHub Desktop.
Returns reverse order of string input
x = str(raw_input("Type a sentence and I will reverse the order of it! "))
def reverse(x):
x = x.split(" ")
for i in x:
f = x[::-1]
f = " ".join(f)
return f
print reverse(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment