What's wrong?


#1

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
first = original[0]
new_word = original + first + pyg
new_word = new_word[1:len(new_word)]

print new_word

else:
print ‘empty’

File “python”, line 7
new_word = original + first + pyg
^
IndentationError: unindent does not match any outer indentation level


#2

please format your code properly so that we can see the indentation what you’ve done for your code.

Error:

IndentationError: unindent does not match any outer indentation level

the error simply says that there is problem with the Indentation.check the sapces for the line.

read comments

if condition:
    print 'something' #  took four 4 spaces before starting the line
    print 'something else' #  took 4 space before starting the line
   print 'something else' #took 3 spaces (IndentationError: unindent does not match any outer indentation level) 



read this topic please


#3

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