Skip to content

Instantly share code, notes, and snippets.

@leifwalsh
Created April 2, 2010 05:10
Show Gist options
  • Save leifwalsh/352781 to your computer and use it in GitHub Desktop.
Save leifwalsh/352781 to your computer and use it in GitHub Desktop.
a = []
for line in raw.readlines():
line = line.split()
if line:
if line[-1] == "space":
a.append(' ')
elif len(line[-1]) > 1:
a.append('?')
else:
a.append(line[-1])
text = ''.join(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment