Not translating


#1

Ok so I have my code, it displays the “Enter a word:” request, but when I enter a word and hit enter, it just changes the color of the word to a darker gray. What am I doing wrong? :

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)]


#2

Perhaps try bypassing the raw_input line (comment it out) and manually supply a string value for original. That should, if permitted be enough to see you through the lesson.


#3

It says I can continue onto the next lesson, but I don’t want to do that until this translator actually works because then I’d just be moving on without a full grasp of the last lesson. I’m not sure what you mean by “commenting out” the ‘raw_input’ line, do you mean using the # symbol? Like this: #raw_input ?


#4
#original = raw_input(‘Enter a word:’)
original = "surprise"

#5

ok but is it my code that is wrong, or is it the interface? Like did I do this section incorrectly, or is it code academy thats not running it properly? Because nothing translates, but it says that I can move on…


#6

I think its an interface issue. If i use the help code ‘Get code’ it still won’t work properly.


#7

Your code looks fine. Remember to print new_word at the end.


#8

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