Skip to content

Instantly share code, notes, and snippets.

@michaeluzzi
Created February 13, 2013 21:19
Show Gist options
  • Save michaeluzzi/4948404 to your computer and use it in GitHub Desktop.
Save michaeluzzi/4948404 to your computer and use it in GitHub Desktop.
This program prints out only the one and two letter words in a given text.
import sys
myWords = []
for line in sys.stdin:
line = line.strip()
words = line.split(" ")
for word in words:
if len(word) < 3:
myWords.append(word)
output = " ".join(myWords)
print output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment