# solution compliments of Abby Ross, with a few changes by Dr. V import urllib # Part One file = urllib.urlopen("http://csfile2.stlawu.local/~ehar/data/words.txt") count = 0 total = 0 for line in file: word=line.strip() word=word.lower() if word[0]==word[-1]: count = count + 1 total = total + 1 percent = float(count)/float(total)*100 print percent,"% of the words started with the same letter they ended with!" # Part Two file = urllib.urlopen("http://csfile2.stlawu.local/~ehar/data/words.txt") for line in file: word=line.strip() word=word.lower() if "a" not in word and "e" not in word and "i" not in word and "o" not in word and "u" not in word and "y" in word and len(word)>=3: print word # Part Three file = urllib.urlopen("http://csfile2.stlawu.local/~ehar/data/words.txt") for line in file: word=line.strip() word=word.lower() counta=0 for letter in word: if letter == "a": counta=counta+1 if counta>=4: print word