Reputation: 232
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()`
Upvotes: -1
Views: 2115
Reputation: 1398
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")
Upvotes: 1