# HG changeset patch # User nvskarunakar@gmail.com # Date 1402649140 -19800 # Node ID 068e3e9935c1bd94f657f1ff5d8ec7067a9eefe1 # Parent 0104466745693af30453e1eb7d01a89a9d35aae3 removed the part of reading a local data file diff -r 010446674569 -r 068e3e9935c1 reverse_lines.py --- 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);