Created
April 26, 2012 20:51
-
-
Save yuheiomori/2503087 to your computer and use it in GitHub Desktop.
CodeEval Reverse Words
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
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