代码拉取完成,页面将自动刷新
import turtle
import math
# Fill a rectangle
def drawRectangle(color = "black",
x = 0, y = 0, width = 30, height = 30):
turtle.color(color)
turtle.begin_fill() # Begin to fill color in a shape
turtle.penup() # Pull the pen up
turtle.goto(x + width / 2, y + height / 2)
turtle.pendown() # Pull the pen down
turtle.right(90)
turtle.forward(height)
turtle.right(90)
turtle.forward(width)
turtle.right(90)
turtle.forward(height)
turtle.right(90)
turtle.forward(width)
turtle.end_fill() # Fill the shape
# Fill a circle
def drawCircle(color = "black", x = 0, y = 0, radius = 50):
turtle.color(color)
turtle.penup() # Pull the pen up
turtle.goto(x, y)
turtle.pendown() # Pull the pen down
turtle.begin_fill() # Begin to fill color in a shape
turtle.circle(radius)
turtle.end_fill() # Fill the shape
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。