这是我已经拥有的代码,但它说我需要定义我知道我需要的“多边形”,但不确定我一直在尝试的方式和不同的方式总是给我错误。
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()
最佳答案
使用圆圈法
import turtle
import math
apple=turtle.Turtle()
def draw_circle(t, r):
turtle.circle(r)
draw_circle(apple, 15)
turtle.exitonclick()
关于python - 如何在 Python 3 中使用 Turtle 绘制圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46695126/