Goose LaMoose
Goose LaMoose

Reputation: 131

Turtle Graphics Color Error Python

I'm trying to run this turtle function:

from turtle import *

def main():


    color('red', 'yellow')
    begin_fill()
    while True:
        forward(200)
        left(170)
        if abs(pos()) < 1:
            break
    end_fill()
    done()

main()

But I keep getting this error:

 Traceback (most recent call last):
File "C:\Users\eardery\Desktop\Final Exam Practice\turtlepolygon.py", line 1, in <module>
 from turtle import *
File "C:\Users\eardery\Desktop\Final Exam Practice\turtle.py", line 234
raise Error, "no color arguments"
           ^
SyntaxError: invalid syntax

I have no idea what this means.

Upvotes: 0

Views: 857

Answers (1)

Joran Beasley
Joran Beasley

Reputation: 113940

you have a file named turtle.py in the same folder ... you should not name files the same as libraries ... you are importing from your local turtle.py file

rename turtle.py (in this same folder) to myturtle.py and it should be fine

Upvotes: 1

Related Questions