from string import lower VOWELS = ("A","E","I","O","U","a","e","i","o","u") English = raw_input("Please enter a sentence using only words and spaces. ") English_words = [] Pig_words = [] English_words = English.split(" ") def convert(word): #if first letter is a vowel if word[:1] in VOWELS: return lower(word+"hay") else: return lower(word[1:]+word[:1]+"ay") Pig = "" #the following is sort of like a join routine for word in English_words: Pig = Pig + convert(word) + " " print Pig