Answer: Turtle Challenge #164

Here’s what the code from Turtle Challenge #164 draws. This picture was made by running the code for real.

The drawing made by turtle challenge 164.
What the turtle drew.

The answers

What does the picture show? A sun! A gold circle with orange rays all round it.

How many rays will it have? 10 rays. t.setheading(ray * 36) points the turtle in a new direction for each ray.

Do the rays touch the circle? No. The turtle moves out 85 steps with the pen up first, which is a little further than the circle’s radius of 70, so there’s a gap.

How the code works

begin_fill() and end_fill() colour in the circle. Then each ray starts from the middle: the turtle jumps out past the edge with its pen up, then draws.

import turtle

t = turtle.Turtle()
t.speed(0)
t.pensize(4)
t.pencolor("orange")
t.fillcolor("gold")

t.penup()
t.goto(0, -70)
t.pendown()
t.begin_fill()
t.circle(70)
t.end_fill()

for ray in range(10):
    t.penup()
    t.goto(0, 0)
    t.setheading(ray * 36)
    t.forward(85)
    t.pendown()
    t.forward(40)

t.hideturtle()
turtle.done()

Try it: Can you add a smiley face to the sun?