Answers for "unindent does not match any outer indentation level"

20

IndentationError: unindent does not match any outer indentation level

# Error:
IndentationError: unindent does not match any outer indentation level

# Explanation:
# This error usually comes up when you are using a mix of spaces and
# tabs for indentation in Python (which is often caused by copy-pasting
# code from somewhere else). To fix, convert all tabs to 4 spaces in
# your text editor. E.g. in Atom, the 'Whitespace: Convert Tabs to 
# Spaces' command that you can find with Cmd+Shift+P works nicely. 

# Note, the PEP8 style guide for Python recommends using 4 spaces for 
# 	indentation instead of tabs. You may need to change the space/tab
# 	settings in your text editor if it's set to auto-convert any of these
# 	characters.
Posted by: Guest on September-27-2020
8

indentation error python unindent does not match

# usually use 4 spaces to indent (don't mix with TABs or IndentationError)
j = 1
site = 'cg'
while(j<= 1):
    if site == 'cg': 
        print('okay') 
    else: 
        print('retry') 
    j += 1
    print ('j: ' + str(j))
print('Done') 					# okay          j: 2        Done
Posted by: Guest on May-13-2021
0

unindent does not match any outer indentation level

[Solved] IndentationError: unindent does not match any outer indentation level
Posted by: Guest on June-21-2021
0

unindent does not match any outer indentation level (<unknown>, line 26)pylint(syntax-error)

"""You have to check the space before each instruction after a condition
The space shall not be composed of little spaces (---) but with long identation
Ex:
"""
#Good position
if x==1:
  print("Ok")

#Wrong position
if X==2:
 print("Erreur")
Posted by: Guest on January-24-2021

Code answers related to "unindent does not match any outer indentation level"

Python Answers by Framework

Browse Popular Code Answers by Language