Jump to content

Python Error: AttributeError: 'Turtle' object has no attribute 'fill'

Go to solution Solved by Rheinwasser,

remove the two lines with fill?

what is this code supposed to do?

maybe the method has a another name or this particular class doesnt have this method.

Hi,

 

My sister has this do as a project and I am trying to help her. Her school account doesn't work, so she could not make it in class. The teacher is not willing to help either. And now I have to help, but I don't know much about python. I would really appreciate your help.

 

This is the code:

 

 

from turtle import*

# bottom circle
title("Snowman")
turtle=Turtle()
turtle.up()
turtle.goto(0,-250)
turtle.down()
turtle.color("black")
turtle.width(width=5)
turtle.fill(1)
turtle.fill(0)
turtle.circle(120)
turtle.hideturtle()
 
# center circle
turtle=Turtle()
turtle.up()
turtle.goto(0,-10)
turtle.down()
turtle.color("black")
turtle.width(width=5)
turtle.fill(1)
turtle.fill(0)
turtle.circle(90)
turtle.hideturtle()
 
# Top circle
turtle=Turtle()
turtle.up()
turtle.goto(0,170)
turtle.down()
turtle.color("black")
turtle.width(width=5)
turtle.fill(1)
turtle.fill(0)
turtle.circle(60)
turtle.hideturtle()
 

 

 

and this is the error message

 

 

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32

Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
Traceback (most recent call last):
  File "C:/Python34/Projects/Snowman.py", line 10, in <module>
    turtle.fill(1)
AttributeError: 'Turtle' object has no attribute 'fill'
>>> 

 

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to post
Share on other sites

remove the two lines with fill?

what is this code supposed to do?

maybe the method has a another name or this particular class doesnt have this method.

Link to post
Share on other sites

remove the two lines with fill?

what is this code supposed to do?

maybe the method has a another name or this particular class doesnt have this method.

 

Thanks man, removing fill worked. They have to make a snowman. 

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to post
Share on other sites

Thanks man, removing fill worked. They have to make a snowman. 

well, i have never coded python but i got that  :)

so the fill method isnt even necessary?

ok, no problem ;-)

Link to post
Share on other sites

well, i have never coded python but i got that  :)

so the fill method isnt even necessary?

ok, no problem ;-)

 

I am kind of angry at her teacher. They just started and now they are supposed to make this. They got a list of code and 50% of the commands are missing. The fill stuff was in the notes though. At least I can always count on help from the forum :D

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to post
Share on other sites

I am kind of angry at her teacher. They just started and now they are supposed to make this. They got a list of code and 50% of the commands are missing. The fill stuff was in the notes though. At least I can always count on help from the forum :D

may i ask in which grade your sister is and on which kind of school?

because i have informatik as well and our teacher told us that we weren't allowed to learn aynthing besides java and delphi in school..

Link to post
Share on other sites

may i ask in which grade your sister is and on which kind of school?

because i have informatik as well and our teacher told us that we weren't allowed to learn aynthing besides java and delphi in school..

 

She is in 8th grade and they are only doing Python. She goes to a "Gymnasium" 

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×