+ 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?

6th Jun 2018, 4:20 PM
Brenda Karimi
Brenda Karimi - avatar
16 odpowiedzi
+ 13
Brenda Karimi : x = 10 if x < 5 : print ("yes") else : print ("no")
6th Jun 2018, 4:45 PM
***
+ 7
It works here fine. I think you have not provided the else statement after indent. https://code.sololearn.com/c2jPYFyF2KpI/?ref=app
6th Jun 2018, 4:47 PM
Akash Pal
Akash Pal - avatar
+ 6
Brenda Karimi Please attach the code so we all can help you.
6th Jun 2018, 4:27 PM
Akash Pal
Akash Pal - avatar
+ 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
6th Jun 2018, 5:02 PM
Akash Pal
Akash Pal - avatar
+ 5
Which software are you using Brenda Karimi ?
6th Jun 2018, 4:50 PM
Akash Pal
Akash Pal - avatar
+ 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!
6th Jun 2018, 5:04 PM
non
+ 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.
6th Jun 2018, 5:26 PM
non
+ 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 😊
6th Jun 2018, 4:50 PM
Brenda Karimi
Brenda Karimi - avatar
+ 3
Akash Pal Thank you so much 😊😊
6th Jun 2018, 4:50 PM
Brenda Karimi
Brenda Karimi - avatar
+ 3
Python 3.6(32-bit) Akash Pal
6th Jun 2018, 4:52 PM
Brenda Karimi
Brenda Karimi - avatar
+ 3
nonzyro what's the difference??
6th Jun 2018, 5:10 PM
Brenda Karimi
Brenda Karimi - avatar
+ 3
Okay. Thanks nonzyro
6th Jun 2018, 6:03 PM
Brenda Karimi
Brenda Karimi - avatar
+ 2
Akash Pal I've posted it on the activity feed as a picture.. I hope you'll be able to see it
6th Jun 2018, 4:35 PM
Brenda Karimi
Brenda Karimi - avatar
+ 2
Thanks Akash Pal
6th Jun 2018, 5:09 PM
Brenda Karimi
Brenda Karimi - avatar
+ 1
Akash Pal I don't know how to insert it here because I've written it on my pc using an added python software and i use my phone for Sololearn 😔
6th Jun 2018, 4:32 PM
Brenda Karimi
Brenda Karimi - avatar
0
.
10th Jun 2018, 4:52 PM
syndicate.fs
syndicate.fs - avatar