网络编程
位置:首页>> 网络编程>> Python编程>> python 动态绘制爱心的示例

python 动态绘制爱心的示例

作者:chuyaoxin  发布时间:2022-10-22 08:20:23 

标签:python,动态,绘制,爱心

代码


import turtle

turtle.bgcolor("black")
turtle.pensize(2)
sizeh = 1.2

def curve():
 for ii in range(200):
   turtle.right(1)
   turtle.forward(1 * sizeh)

turtle.speed(0)
turtle.color("red", "red")
turtle.begin_fill()
turtle.left(140)
turtle.forward(111.65 * sizeh)
curve()
turtle.left(120)
curve()
turtle.forward(111.65 * sizeh)
turtle.end_fill()
turtle.hideturtle()

效果图

python 动态绘制爱心的示例

来源:https://www.cnblogs.com/cyx-b/p/12934335.html

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com