这是我已经拥有的代码,但它说我需要定义我知道我需要定义的“多边形”,但不确定我一直在尝试的方式和不同方式一直给我错误。
import turtle
import math
apple=turtle.Turtle()
def draw_circle(t, r):
circumference = 2 * math.pi * r
n = 50
length = circumference / n
polygon(t, n, length)
draw_circle(apple, 15)
turtle.exitonclick()
原文由 Alyssa Kelley 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果你真的需要定义一个多边形。