Indentation Error for a loop
<p>I keep getting a IndentationError: expected an indented block. Why is this error occurring?</p>

<pre><code>import arcpy
from arcpy import env
env.workspace = r'D:\Programming\Lab1\lab1.gdb'
env.overwriteOutput = 1
env.qualifiedFieldNames = "UNQUALIFIED"

#list the feature classes
soils = arcpy.ListFeatureClasses()

for soils in arcpy.ListFeatureClasses():
</code></pre>

<p>Python is expecting an indented block, which wasn't there:</p>

<pre><code>for soils in arcpy.ListFeatureClasses():
    # here should be something
</code></pre>

<p>By providing some values we solve the problem, for example by putting <code>pass</code> value, which does nothing, but solves <code>IndentationError</code> issue.</p>

<pre><code>for soils in arcpy.ListFeatureClasses():
    pass
</code></pre>

<p>There is another trick:</p>

<pre><code>for soils in arcpy.ListFeatureClasses(): pass
</code></pre>

<p>which also solves that issue.</p>

python