I get the following indentation error
>>> number = 35
>>> if number == 35:
print 'true'
else:
File "<pyshell#130>", line 3
else:
^
IndentationError: unindent does not match any outer indentation level
>>>
This happens only on IDLE and not on command line. I am using Python 2.6.4 on Windows XP. I have searched online, but not been able to find any answer as to why I get this error. Thankful for any help.
And to add - The code may not look properly indented when copied and pasted. But it was properly indented on the IDLE interface.
>>> number = 35
>>> if number == 35:
... print 'true'
... else:
... print 'false'
...
true
>>>
indent your code properly and manually
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With