# work in progress; ideas for future include: # (1) transfer capitalization to the translated word (This => Isthay, not isThay) # (2) skip "aay" as a translation of "a" since the preceding word had "ay" # (3) translate a string to a string, rather than needing a list of words exceptions = {'hour':'houray'} def vowel_finder(word): for i in range ( len(word)): if word[i] in 'aeiouAEIOU': return i return 'wrong language' def pigWord(word): if word in exceptions: return exceptions[word] characters = vowel_finder(word) if characters == 'wrong language': return 'bad' else: return word[characters:] + word[:characters] + 'ay' def pigWords(words): return [pigWord(word) for word in words]