1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Confusing error message while using turtle in Python 3

Discussão em 'Python' iniciado por Stack, Setembro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I'm doing a CSP assignment for school and I was getting a rather confusing error message while I was testing whether the color portion of my code functioned. This is my code:

    import turtle
    turtle = turtle.Turtle
    turtle.color("brown")


    And this is the error message

    Traceback (most recent call last):
    File "/tmp/sessions/1ab7a960b2c10b4b/main.py", line 3, in <module>
    turtle.pencolor("brown")
    File "/usr/lib/python3.6/turtle.py", line 2257, in pencolor
    return self._color(self._pencolor)
    AttributeError: 'str' object has no attribute '_color'


    It does not make any bit of sense to me, as I am somewhat new to python. Help?

    Continue reading...

Compartilhe esta Página