"word should contain the .lower()-case version of original" error


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


word should contain the .lower()-case version of original


I am getting an error saying that I need to have .lower()case version even though I have it in my code. When I enter an uppercase word, the output is in correct pig latin and lowercase.


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


#2

The lesson checker expects word to be unchanged in the program. Leave the slicing until after the new-word line. Both of those two lines may be removed.

new_word = new_word[...]

#3

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