10.Ending it up


pyg = "ay"
print 'Welcome to the Pig Latin Translator!'
name = raw_input("What's your name:")
original = raw_input("Enter a word %s:" % name)
if len(original) > 0 and original.isalpha():
print original
word = original.lower()
first = word[0]
new_word = new_word[1:] + word + first + pyg
print new_word
elif len(original) <= 0:
print "You didn't type a word "
print "It can only contain alphabetical letters"

it works but i cant continue here is the error message:
Oops, try again. It looks like new_word contains "yvayviggovaykkayccayggayaaay" instead of "aay"!


Hello, @quison!
One of the problems with your code is that you're trying to slice a string stored into new_word but there's nothing in there.
If you try to run your code in another compiler, fixing the indentation, you'll see the following error:

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

The other thing is: you're getting the entire word, which was informed by the user and later stored in word when you did original.lower(), concatenating with first, which contains the first character of the string stored in word, and again concatenating with pyg, which contains "ay".
The output, removing the new_word[1:] would be "cakecay" where it should be "akecay".

Try to fix that exact same line , it's just a little thing that you should do!

Hint: same thing you did with new_word but without new_word since it's "empty".

Quote me if there's anything else I can help you with!

Best regards,