+ 2

how to fix this error

kod=[0 for i in range(100)] n=int(input('zadaj n: ')) i=1 delitel=n abc=2 while (delitel!=0): if delitel % 2 == 0: kod[i]=0 if delitel % 2 == 0: kod[i]=1 delitel = delitel // 2 i = i+1 for j in range(len(kod)): print (kod[j]) so when i try to run this code it says this: File "binarina.py", line 13 delitel = delitel // 2 ^ IndentationError: unindent does not match any outer indentation level running in sublime 3, no idea what to do, please help guys

19th Oct 2017, 6:10 PM
dominik
dominik - avatar
3 Answers
+ 4
ffs.. It runs well now, thx. I had a headache form this :D
19th Oct 2017, 6:26 PM
dominik
dominik - avatar
+ 2
"IndentationError: unindent does not match any outer indentation level" As it says in the error, fix your indentation to make it line up with the IF statements above it since it's part of your loop also. Another fine example of how annoying Python syntax/structure is.
19th Oct 2017, 6:16 PM
AgentSmith
+ 2
You might one to try and ide such as pycharm. It will assist with formatting issues.
20th Oct 2017, 11:18 PM
Groot
Groot - avatar