Wrong instructions to "10. Ending Up"-part of PygLatin section


#1

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

Traceback (most recent call last):
File "python", line 6, in
NameError: name 'new_word' is not defined

I think, the instruction to this part is wrong, because it tells you to use [1:len(new_word)] while you're just defining the variable "new_word". When I changed this to [1:len(word)] or just [1:] - everything was well. I assume I could be wrong - anyways, maybe it'll help someone with similar problem... Thank you.

pyg = 'ay'

original = raw_input('Enter a word:')
word=original.lower()
first=word[0]
new_word=word[1:len(new_word)]+first+pyg

if len(original) > 0 and original.isalpha():
    print (new_word)
else:
    print 'empty'

#2

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