Answers for "python inconsistent use of tabs and spaces in indentation"

9

python inconsistent use of tabs and spaces in indentation

# Error:
inconsistent use of tabs and spaces in indentation

# Solution:
# 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
1

inconsistent use of tabs and spaces in indentation

# Try whitespace insted of tabs for that error line
Posted by: Guest on August-27-2021

Code answers related to "python inconsistent use of tabs and spaces in indentation"

Python Answers by Framework

Browse Popular Code Answers by Language