Created
February 13, 2013 21:19
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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