-1

I have some Python code that does not run. The error message says:

unindent does not match any outer indentation level

def main1():       

        password = "LPPJJAS"
        user_input = raw_input('Please Enter Password: ')

        if user_input == password:
                print 'All distances have been split so one pixel is equal to two centimetres'
               time.sleep(1)


        elif user_input != password:
                print 'Incorrect Password, terminating... \n'
                exit("pow")

if __name__ == "__main__":
        main1()`
Undo
  • 25,519
  • 37
  • 106
  • 129
Pranav Sharma
  • 232
  • 2
  • 8
  • 3
    The error message should give you a hint as to where, but to me it looks like an extra space before `print 'All distances...'` – Will Aug 07 '15 at 03:08

1 Answers1

1

There is an extra space before line 5 - print 'All distances.... Python expects equal indents for every line. (Usually 4 spaces.)

password = "LPPJJAS"
user_input = raw_input('Please Enter Password: ')

if user_input == password:
    print 'All distances have been split so one pixel is equal to two centimetres'
    time.sleep(1)

elif user_input != password:
    print 'Incorrect Password, terminating... \n'
    exit("pow")
selllikesybok
  • 1,250
  • 11
  • 17
weirdev
  • 1,388
  • 8
  • 20