Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 12 Online
OpenStudy (anonymous):

there is always a problem in idle while using 'else'. it gives indentation error. please help

OpenStudy (anonymous):

Make sure you use tab to indent the IF and ELSE sections. I am assuming this is Python. You might have to paste your code snippet.

OpenStudy (anonymous):

"unindent does not match any outer indentation level" this the t shows always, i have tried in different ways.

OpenStudy (turingtest):

it should be like so if <boolean>: <code> else: <code>

OpenStudy (anonymous):

>>> x=35 >>> if x==35: print 'true' else: File "<pyshell#3>", line 3 else: ^ IndentationError: unindent does not match any outer indentation level

OpenStudy (turingtest):

well, the way you copy-pasted it I can't tell how your indents are written, the >>> is throwing me off.

OpenStudy (anonymous):

x=35 if x==35: print 'true' else: File "<pyshell#3>", line 3 else: ^ IndentationError: unindent does not match any outer indentation level

OpenStudy (turingtest):

I hope you're not typing this directly into the shell. Open a new window with CTRL+N and type in your program, then run it with F5. If that doesn't work, copy paste that code here so we can see the indentation properly, the >>> from the shell is making it hard to see what you actually typed.

OpenStudy (anonymous):

thank you so much. its is very helpful,and it is woking

OpenStudy (turingtest):

glad that's all it was :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!