Help me! (Ending UP)


Oops, try again. It looks like new_word contains "dodday" instead of "odday"!

I inserted dodo and I expected ododay to show, i am aware i didnt change anything, but i need help (pls no anwsers)

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


Instead of setting new_word to word+first+pyg try setting it to [1:len(new_word)] + first + pyg, like the lesson's instructions say. :slight_smile:


Your variables should go right after if statement.if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word = word[1:len(new_word)] + first + pyg
print new_word


Thank You! I just double checked it! and it was a silly mistake... by the way, are there tutorials for Python 3x, In codeacademy?



May I ask why you don't use a 's' like below?



We do, it should be word[1:]+first+pyg, something I may have omitted in my original post. Instead of s we use word, the string being spliced.


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