Nested if and expected an indent block

Simon Forman rogue_pedro at yahoo.com
Sun Aug 13 21:30:55 EDT 2006


kagard at gmail.com wrote:
> Dustan wrote:
>
> >
> > To see the full traceback, assuming you're using windows, you need to
> > run it on the Command prompt.
>
> Hi Dustan:
>
> Here's the traceback:
>
> C:\docs\Python>SylloSolver.py
>   File "C:\docs\Python\SylloSolver.py", line
>     """
>       ^
> IndentationError: expected an indented block
>
> I got rid of the triple quote string at the start of the function, and
> that cleared up the problem, though I don't know why.
>
> Thanks
>
> Keith

Ah, yes. The docstring for a function (or at least its first
triple-quote) must be indented to the same degree as its statements.
(If you're using IDLE it should have indented it for you when you hit
return after the def statement.)

HTH,
~Simon




More information about the Python-list mailing list