Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pig latin translator python

def pig_latin(word):
    word = word.strip().lower()
    pig_latin =''
    vowel = ['a','e','i','o','u']
    for i in range(len(word)):
        if word[i] in vowel:
            if i==0:
                word+="w"
            pig_latin+=word[i:]+word[0:i]+"ay"
            break
    return pig_latin
Source by codereview.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #pig #latin #translator #python
ADD COMMENT
Topic
Name
3+4 =