Code not working


#1

MY CODE IS
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 = new_word[1:len(new_word)]
print (new_word)
else:
print ('empty')

THE ERROR IS
File "python", line 9
else:
^
SyntaxError: invalid syntax


#2

Indent your code properly,

if/else statement will be like this..

if condition:
    #yourcode  
else:
    #yourcode

#3

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