Error


#1

Can somebody help me ?

pyg = 'ay'

original = raw_input('Enter a word:')

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

The error says "Oops, try again. It looks like you printed the correct translation of "wordfirstpyg", but make sure to set new_word equal to the slice as well".


#2

Word looks like a string, so why are you slicing it? Try to remove the quotation marks. Also the variable var seems very useless, so remove it.


#3

Thank you, i've got it! :slight_smile:


#4

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