Ending Up, Keeps saying I am wrong but it executes correctly



The error message says this
Oops, try again. It looks like you printed the correct translation of "rubber", but make sure to set new_word equal to the slice as well.

However, on the right hand side, it actually did execute properly and printed ubberray. So, it looks like this

Enter a word: rubber

Is this not how the pyglatin works? I'm a bit confused. What did I do wrong?

pyg = 'ay'

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


Your code works but it is not following CC interpreter's instruction!

actually introduce a new line of code and do as message says. (new_word equal to the slice as well)

new_word [1: ] this is your sliced text!


Thanx! It took me some tries to understand what you were hinting at, but I got it in the end!


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