Problem with indention in python turtle


For some reason, it keeps on saying that my indention is incorrect.

The code was simple. Basically:

import turtle
t = turtle.Pen()

for x in range(100):



When I pressed enter, there was automatic indention, so I did not use space/tab. But when I try to run it, the indention is somehow incorrect. I tried to delete do the indention again and again but it never worked for some reason.

How can I fix this problem…?


Hi @onlysmartpeoplecanse

Some of the indentation in your posted code is not visible.

If this line is indented in the actual code that you submitted to the Python interpreter, it would raise an IndentationError

t = turtle.Pen()

These two lines do need to be indented …



Be sure to use either spaces or tabs for the indentation, but not both in the same program.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.