Pyglatin


#1




my code is exucted and passes as it should do,but the output is not as expected.


It is a Pig Latin translator.but the output is exactly the same as the input which contradicts the aim of the code.


Replace this line with your code. 
pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word=original.lower()
    first=word[0]
    new_word = word+first+pyg
    new_word=new_word[1:len(new_word)]
    print original
else:
    print 'empty'
    print new_word


#2

Hi, @designplayer63179 ,

You have this line in the else block ...

print new_word

That line should instead replace the final line in the if block. When the user enters a valid word, we need to see the translation rather than the original word again.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.