Problem with pyg latin translator


#1

https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/ending-up?action=resume_content_item&link_content_target=interstitial_undefined

My code runs correctly, but I’m not getting the green light.

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
  print new_word[1:len(new_word)]
else:
  print 'empty'

Result:

Enter a word:Test
esttay

Error Message:

It looks like you printed the correct translation of “test”, but make sure to set new_word equal to the slice as well.

I know that the error message tells me what I’m getting wrong. But I can’t figure out how to fix that.


#2

The instructions ask us to complete new_word in one final assignment, then to print new_word.


#3

@mtf Thanks! That really helped me to find the solutions.


#4

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