Error in pyglatin ending up


#1



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


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 first
print new_word
print new_word[1:len(new_word)]
else:
print 'empty'


Replace this line with your code.


#2

If you post your whole code for this lesson we can help you out! Just the error message won't help us to help you solve your problem!


#3

I'm having the same error. I'm getting frustrated so I'm taking a break for a while haha. Thanks!
Below is my code. I have proper indents btw. Not sure why its not showing up properly when I post it.
EDIT EDIT EDIT:
added new_word = new_word[1:] and that seemed to fix it

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
new_word = new_word[1:]
print new_word
else:
print 'empty'


#4

thanks it works great lol


#5

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