Problem with Python PygLatin


#1

Hi! I was finishing up my python pygLatin translator, and came to the testing, testing part of the task. Everything has been working out just fine before, but all of a suddent my code wont work!

MY 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)]
else:
print ‘empty’

could anybody help me understand what went wrong?


#2

what output does it give?


#3

It does not give an output! The input (write a word) part shows up, but when I’ve written an word and pressed enter, nothing happens


#4

I looked over the code and I believe that you forgot your “print” in the code.


#5

Yes, pythoncoderboy is correct, there should be a:

print ‘new_word’ inside the if statement


#6

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