Code not working


#1

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():

print original
word=original.lower() first=word[0]

else:
print 'empty'

could someone tell me what's wrong with my code?
the interpreter returns "invalid syntax" for the part 'first=word[0]


#2

Hey @andrewjf please format all your code together so I can take a good look at it


#3

your indent is not right, first = word[0] needs to be in next line


#4

Hey, here's all the code as seen in the editor window

 pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():

    print original
    word=original.lower() first=word[0] 
else:
    print 'empty'

#5

Okay now I see your problem put the 'first = word[0]' statement on another line.


#6

Hey, that worked ! thanks so much ! I wasn't aware that each defined variable needs to be in a new line


#7

Yupp worked ! thanks so much for the prompt responses ! really appreciate it!


#8

No problem :sweat_smile: You found me when I was online. feel free to message me when you're stuck @andrewjf


#9

For sure! thanks for the offer!


#10

Word up. Keep coding! :sunglasses: