0
Pig Latin in Python 2/5 Tests Failed
I'm not sure what I'm missing. In the cases that aren't hidden and one that is. I've got them right. Two of the hidden one's are wrong so I can't find the problem. Please can you look at my code and help me. Thanks https://code.sololearn.com/ccR5HYVL3qIF/?ref=app
4 Answers
+ 6
sentence = input().split()
print(" ".join(w[1:] + w[0] + "ay"
for w in sentence))
Pig Latin answer đ
+ 2
This is the easiest answer...just append what u need in empty list and join them to make a string from list
name = input()
n = []
for i in name.split(" "):
n.append(i[1:] + i[0] + "ay" + " ")
print("".join(n))
+ 1
you can change it to
y4 = y[1:] + y2 + "ay"
and remove
y3 = y.replace(y2, "")
thanks for commenting your code, well done.
0
Thanks. Please could explain why changing that makes it work. Since my code still translates the English Sentence into Pig Latin