Another excellent example of why defining the line for 'pure' Python questions is going to be difficult: Using variable in SelectByAttribute_management.
At the lowest level possible, it is purely a Python syntax issue.
However, the error given would indicate an error outside of Python, within the ArcGIS API:
Runtime error Traceback (most recent call last): File "",
line 1, in File "c:\program files
(x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 6435, in
SelectLayerByAttribute raise e ExecuteError: ERROR 000358: Invalid
expression Failed to execute (SelectLayerByAttribute).
If you look up this error message you'll find:
The SQL expression is invalid.
It takes knowledge of both ArcGIS and Python to understand what the problem is and what the solution should be.
Now, the question is, should I answer this? It's actually fairly simple, and I've already spent more time creating this answer than it would have taken to do that.
I could also vote to close it as off-topic. But, given the fact that I've already taken the time to read and understand the question, and I know a solution, am I really improving this community by voting to close this question?
At the very least, I believe trying to define what is 'pure' Python is going to be a moving target, and something this community will struggle with on an on-going basis.