Skip to content

Instantly share code, notes, and snippets.

@yuheiomori
Created April 26, 2012 20:51
Show Gist options
  • Save yuheiomori/2503087 to your computer and use it in GitHub Desktop.
Save yuheiomori/2503087 to your computer and use it in GitHub Desktop.
CodeEval Reverse Words
import sys
def split_line(line):
return line.split()
def reverse_list(l):
return l[::-1]
test_cases = open(sys.argv[1], 'r')
for line in test_cases:
print(' '.join(reverse_list(split_line(line))))
test_cases.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment