Ending Up


pyg = 'ay'

original = raw_input('Enter a word:')

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

I don't get it


Hi @sammygun,

Instead of this ...

print new_word[1:len(new_word)]

... assign the result of that slice operation to new_word, and then you can do this ...

print new_word


Do you mean this?


According to Codecademy's test, that works. :smiley:

You have assigned the translated input to new_word.

However, it would be best to move these two statements into the if block ...

first = word[0]
new_word = word[1:] + first + pyg

This way, we make sure that the user entered a valid word before we perform the translation process.


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