Que estoy haciendo mal? / what am i doing wrong


#1

ES: Saludos
Estoy en la parte del pig latin 9. IA IA OU, y sinceramente no entiendo que esta mal, sigo las instrucciones que me da la pagina para resolver el ejercicio y no le veo el problema la verdad, no entiendo porque mi codigo esta mal, gracias por la ayuda
EN: Greetings:
Right now im on the pig latin part 9 IA IA OU and honestly I dont know what am i doing wrong, i follow the instructions that the website is giving me to solve the problem, yet i just dont see the issue, why my code is wrong?, i just don get it; thanks for your help

pyg = 'ei'

original = raw_input('Escribe una palabra:')

if len(original) > 0 and original.isalpha():
palabra = original.lower()
primera = original[0]
print original
if primera == 'a' or primera == 'i' or primera == 'u' or primera == 'e' or primera == 'o':
return "vocal"
else:
return "consonante"
else:
print 'Vacío'


#2
pyg = 'ei'

original = raw_input('Escribe una palabra:')

if len(original) > 0 and original.isalpha():
    palabra = original.lower()
primera = original[0]
print original
if primera == 'a'
or primera == 'i'
or primera == 'u'
or primera == 'e'
or primera == 'o':
    **return** "vocal"
else :
    **return** "consonante"
**else :**
    print 'Vacío'

Hey there, @eggbert21!
The problem with your code is:
1) You're using return, which is a "reserved word" to print out a result or something when you're using functions which is not your case. So instead of "return", use "print".

2) Your last else doesn't seem to be on the right place. You can use an else without an if when it comes to loops. You can use an else after a for loop to check a condition but not in this case.
Other than that, there's no "else" without an "if".

If you fix those things and remove the test lines, your code will work!

Best regards,

g4be


#3

Thank you very much for your answer :smiley: , it seems that it was what you mectioned; and also this weird error regarding spaces as well.


#4

Whitespaces and tabs can be dangerous so watch for that!
Glad I could help!

Just quote me if there's something else you need help :slightly_smiling:

Best regards,
g4be


#5

Thanks a lot :slightly_smiling: