Mercurial > repos > nvskarunakar > file_utils
diff reverse_lines.py @ 1:068e3e9935c1 default tip
removed the part of reading a local data file
author | nvskarunakar@gmail.com |
---|---|
date | Fri, 13 Jun 2014 14:15:40 +0530 |
parents | 010446674569 |
children |
line wrap: on
line diff
--- a/reverse_lines.py Fri Jun 13 14:13:18 2014 +0530 +++ b/reverse_lines.py Fri Jun 13 14:15:40 2014 +0530 @@ -3,13 +3,6 @@ def string_reverse(text): return text[::-1] -f = open('data') -lines = f.read().splitlines() -f.close() - -for i, line in enumerate(lines): - print "{line} becomes {reversed_line}".format(line=line, reversed_line=string_reverse(line)); - lines = sys.stdin.read().splitlines() for i, line in enumerate(lines): print string_reverse(line);