I'm trying to create an application that takes a string and converts it into Pig Latin in Python. The code I have so far is this:
test = "hello world"
def PigLatin():
split_test = test.split()
for i in split_test:
wordlist = list(i)
wordlist.append(i[0])
return wordlist
print PigLatin()
I'm attempting to take the first character of each word and append it to the end of said word. However, when I run the code it only edits "hello" or "world" depending on the location of the return statement. What am I doing wrong here? Any help would be greatly appreciated.