-2
from TurtleWorld import *
import math

bob = Turtle()
print(bob)

draw_circle(turtle, r):
    d = r*2
    c = d*math.pi
    degrees = 360/25
    length = c // 25
    for i in range(25):
        fd(turtle, length)
        rt(turtle, degrees)

draw_circle(bob, 25)

wait_for_user()

The problem in on line 7:

draw_circle(turtle, r):

The compiler only tells me that there is a syntax error and highlights the colon at the end of that line. I'm sure I'm missing something simple, but the code looks right to me.

4 Answers 4

2

in python, we define functions using the def keyword.. like

def draw_circle(turtle, r):
    # ...
Sign up to request clarification or add additional context in comments.

Comments

1

You need to write:

def draw_circle(turtle, r):

to define a function.

Comments

1

http://docs.python.org/release/3.0.1/tutorial/controlflow.html#defining-functions

Your missing the def part?

Comments

0

I thought, just in case the other three answers weren't obvious enough, I should tell you that you need def first

def draw_circle(turtle, r):

@People duplicating: Seriously, could we get 1 more answer? I believe 3 (4 if you add me) isn't enough

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.