Wierd error


#1



Why in this code ( : ) colon become an invalid syntax? Getting no idea.

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


python

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 = [1:len(new_word)]
print original

else:
print"empty"


#2

Correct these:

new_word = [1:len(new_word)] should be new_word = new_word[1:len(new_word)]

print original should be print new_word


#3

Thank You. :slight_smile:


#4

Your welcome. If you have any trouble with Python, just provide me with the link and I will tell you the corrections you need to make- or I'll just tell you that I don't know. xD


#5

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