annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
1 import sys
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
2
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
3 def string_reverse(text):
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
4 return text[::-1]
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
5
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
6 lines = sys.stdin.read().splitlines()
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
7 for i, line in enumerate(lines):
010446674569 first draft
nvskarunakar@gmail.com
parents:
diff changeset
8 print string_reverse(line);