I’m getting an IndentationError. How do I fix it?
I have a Python script:
I have a Python script:
When I compile the Python code below, I get
So I’m using Python 2.7, using the json module to encode the following data structure:
The most popular way of indenting Python is with spaces only.
Sorry: IndentationError: (‘unindent does not match any outer indentation level’, (‘wsn.py’, 1016, 30, “ttelif command == ‘IDENTIFY’:n”))
Convert Indentation to Spaces
I decided, that I learn a bit of Python. The first introduction says that it uses indentation to group statements. While the best habit is clearly to use just one of these what happens if I interchange them? How many spaces will be considered equal to one tab? Or will it fail to work at all if tabs and spaces are mixed?