IndentationError


#1

Hello people!

I have a trouble with coding a line.

It says ‘unexpected indent’, but I thought I did it correctly. It is right under the line, because those 2 lines are the same. I mean they are both ‘variable = string’.
The 8th line is wrong!!
I write it down here, to make it clearer;

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)]
else:
    print 'empty'

Thank you for your help!


#2

Be sure that the indentation matches on all lines inside the if statement. Recommend clear all indents and do over using four spaces, not tabs.


#3

It worked, thank you!


#4

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