My correction of PygLatin


Hello there,

I've done the PygLatin and I would share my code because there aren't corrections on codecademy :

print "Bienvenue dans le traducteur francais - Pyg Latin !"

pyg = "ay"
original = raw_input("Entrez un mot ici:")

if len("original") > 0 and original.isalpha():
print("C'est parti pour la traduction:")

print "vide"

mot = original.lower()
premiere = mot[0]
nouveau_mot = mot + pyg
consonne = mot[1:] + premiere + pyg

if premiere in ["a", "e", "i", "o", "u", "y"]:
print nouveau_mot

print consonne

It's a little bit optimised, enjoy !


I tried to replace if premiere in ["a", "e", "i", "o", "u", "y"]: by if premiere == "a" or "e" or "u" or "i" or "o" or"y": but that does not work. Do you know why?


Hi lefourbecaptain,

try : if premiere == ("a", "e", "i", "o", "u", "y"): ( Don't forget the : )

It's also perhaps an error from codecademy, I don't know..

I hope that help you..

See u


Hello godzongis,

if len("original") > 0 and original.isalpha():

You did a little mistake here the right way is :

if len(original) > 0 and original.isalpha():