[Tutor] What's an IndentationError & How Do I Fix It

Dorje Kawabata dorje.kawabata at gmail.com
Sat Mar 12 17:20:24 CET 2011


I'm using the python interpreter and entered the following code:

>>> for page in range(1,6):
... search_results.append(twitter_search.search(q="#prayforjapan", rpp=100,
page=page))

And received this:
  File "<stdin>", line 2
    search_results.append(twitter_search.search(q="#prayforjapan", rpp=100,
page=page))

IndentationError: expected an indented block

I'm learning python as my first language since coding Basic in 6th grade
(over 30 years ago). I assume that in a text editor I would simply indent
the code.

*My question is how do I fix this in the interpreter? What do I type?*

I'm running python 2.7.1, Mac OS 10.6.6, from the terminal.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110312/db18c68e/attachment.html>


More information about the Tutor mailing list