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


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096


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
ubberray
none

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: ]
else:
    print 'empty'


#2

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)

hint**
new_word [1: ] this is your sliced text!


#3

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


#4

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