Ending Up


#1



File "python", line 12
new_word = [1:len(new_word)]
^
SyntaxError: invalid syntax


Cannot get this to work. I think I missed a step in a previous section, but it accepted it anyway. Help?


Replace this line with your code. 
pyg = 'ay'
original = raw_input('Enter a word:')

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


#2

You are missing a variable that should have been included in the previous exercise, perhaps go back an exercise or two and just cross reference your code with the instructions. :slight_smile:


#3

What variable? Do you know which exercise I might have missed?


#4

You missed this exercise,

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


#5

Looking at it here, still cannot see which variable I might have missed.


#6

Actually scratch that. I did have it copied in already, it was just I posted edited code. Editing now.


#7

print 'Welcome to the Pig Latin Translator!'
raw_input("Enter a World:")
original=raw_input()
x="j123"
if len(original) >0 and x.isalpha():
print(original)
print (x.isalpha)
else :
print"empty"

Start coding here!


#8

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