9.Move it on Back HELP!


#1

I have no idea what is going on here. I'm pretty sure I've created the variable new_word as requested but it keeps returning asking "have you created the variable new_word?".

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

#2

Here:

Should be:

first = word[0]

to get it right! :slight_smile:


#3

Thanks, that's not the problem though it still asks to set the new_word variable :frowning:


#4

Well, some spacing issue maybe.

See full code now:

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

Does this resolve?


#5

I did a straight copy of your code, and still asks if i have made it...


#6

Uhmm... I just ran it and it worked perfectly.

Really surprised! :thinking:


#7

Refresh browser and maybe network then copy and paste exactly.


#8

I've just found the problem - when trying to progress, i was just hitting enter to get through. you need to actually enter text for it to progress. Nothing wrong with the code. Weird! Thanks for the help


#9

Oooo... Good you discovered that.

I presumed you knew to do so! :slight_smile:


#10

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