I don't understand my syntax error


#1



pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

Hey there @dominicshuey

This part:

should be in the if statement (I know this is not part of the syntax error just a quick reminder).

The syntax error is this:

Particularly this bit

Reading back the instructions, you were supposed to concatenate word variable with first and pyg variable. You didn't need to use the length of new_world (anyways it would have generated an error since you are creating variable new_world so you can't use it inside itself).

If you don't understand what I am saying, remove this part

and replace it with word variable to make pyglatin!

If you are still confused, reply back.

Hope this helped,


#3

so this is what I ended with. I saw it on another thread. Can you explain the second to last line?

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
print original

else:
print 'empty'

first = word[0]
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
print new_word


#4

past that with this code here

PYG = 'y'

original = raw_input ( 'Enter a word:')

if len (original)> 0 and original.isalpha ():
original.lower word = ()
original print

first = word [0]
new_word = word + first + PYG
new_word new_word = [1: len (new_word)]
print new_word

but algotá going wrong letters estam not resutado lower left is this

Enter a word: DOG
DOG
ogday
none


#5

You know what to do boat .lower () in the original print stayed like print original.lower ()