Pig Latin HELP
en = input() wl = list(en.split()) for i in wl: a = wl[i] a += a a += ('ay') a = a[i][1:] print(str(wl)) It says a = wl[i] is wrong WHY?
en = "Hello World" en.split() would split it by words and return a list with the following elements - ['Hello' , 'World'] So if there's only one word in the input, there will be only one element in that list. So w will give an "index out of range" error. What you are want is to split the word by "letters". For that, Replace the 2nd line with - wl = list(en) And it should work. Tell me if it works for you after trying this.
Ooooh, I got it! I forgot that the first element is  but not 
Here is final code: en = input() wl = en.split() word = 0 for i in wl: wl[word] += wl[word] wl[word] += 'ay' wl[word] = wl[word][1:] word += 1 print(' '.join(wl))
Oh, haha. Glad you got the answer.
Application RAM usage
About Java McQ