答案 0 :(得分:0)
所以...没人能回答我的问题吗?
这不是一个难题-您甚至有不需要的循环:
from turtle import Screen, Turtle
def origin_circle(turtle, diameter):
turtle.dot(diameter * 4, 'black')
turtle.dot(diameter * 3, 'cyan')
turtle.dot(diameter * 2, 'red')
turtle.dot(diameter, 'yellow')
diameter = float(input("Diameter of target center: "))
x_coordinate = float(input("X coordinate of target center: "))
y_coordinate = float(input("Y coordinate of target center: "))
screen = Screen()
turtle = Turtle()
turtle.hideturtle()
turtle.penup()
turtle.goto(x_coordinate, y_coordinate)
origin_circle(turtle, diameter)
screen.exitonclick()
请注意,turtle.dot()
以一个直径作为输入,并在笔为上或下时绘制,但是{{1} }使用turtle.circle()
,并且仅在放下笔时才进行绘制。