+ 3
How to fix python error: unindent doesn't match any outer indentation level.
I am trying to write the code for else statements on my pc but every time I get to the else statement an error appears saying that unindent doesn't match any indentation level. What am I doing wrong?
16 Antworten
+ 13
Brenda Karimi :
x = 10
if x < 5 :
print ("yes")
else :
print ("no")
+ 7
It works here fine. I think you have not provided the else statement after indent.
https://code.sololearn.com/c2jPYFyF2KpI/?ref=app
+ 6
Brenda Karimi Please attach the code so we all can help you.
+ 6
The Python Is 32 bits
I think you are using Python IDLE
Go to setting -> System-> About -> System Type
And see the operating system processor
PyCharm -> Most recommend python IDE
You can download the Community Edition (free) or professional edition (paid)
If you are a student go to
https://www.jetbrains.com/student/
For getting the professional edition for free
+ 5
Which software are you using Brenda Karimi ?
+ 5
Make sure you don't confuse _tab_ and _spaces_ for _indents_. The SL Playground may mess this up if you copy+paste to/from outside programs!
+ 5
Maybe it _looked_ indented correctly on the Playground but the formatting got messed when you pasted it (I'm obviously talking more complex code). It's easy to miss something while debugging.
+ 4
Rohan Karan It works just fine on Sololearn code playground but the same code brings an error on the software.. I guess there are certain rules to the software that i don't know about.. But thanks a lot 😊
+ 3
Akash Pal Thank you so much 😊😊
+ 3
nonzyro what's the difference??
+ 3
Okay. Thanks nonzyro
+ 2
Akash Pal I've posted it on the activity feed as a picture.. I hope you'll be able to see it
+ 2
Thanks Akash Pal
0
.