What am I doing wrong?


#1


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

File "python", line 12
else:
^
SyntaxError: invalid syntax


I expect it to read and run until the end like it's supposed to; however, unless I indent the else statement, an indent error message appears. When I indent the else statement on line 12, that error message appears.


pyg = 'ay'

original = raw_input('Enter a word:')

word = original.lower()

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

if len(original) > 0 and original.isalpha():
    
    else:
    print 'empty'


#2

The suite (group of statements) of an if-statement can't be empty (what would be the point)


#4

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