当前位置:首页 / 文章测试 / 爱心与扇形

爱心与扇形

开始打字练习

import turtle as t

# 绘制爱心

t.color('red')

t.hideturtle()

t.left(45)

t.begin_fill()

t.forward(200)

t.circle(100,180)

t.right(90)

t.circle(100,180)

t.forward(200)

t.end_fill()

# 绘制彩色扇形

t.penup()

t.goto(0,-200)

t.pendown()

listc = ['red', 'yellow', 'blue', 'green']

for i in range(4):

t.fillcolor(listc[i])

t.begin_fill()

# 绘制扇形

t.setheading(-45 + 360/4 * i)

t.forward(150)

t.left(90)

t.circle(150, 45)

t.goto(0,-200)

t.end_fill()

声明:以上文章均为用户自行发布,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。

本文打字速度TOP10

  • 暂无打字数据!