Python-turtle库-绘制图像


```python
#画雪人
import turtle as t
t.setup(800, 800)
t.speed(100)
t.pencolor("purple")
t.pensize(10)
t.circle(100)
t.seth(180)
t.circle(130)
t.penup() #画左耳朵
t.goto(-50, 100 + 50 * (3**0.5))
t.pendown()
t.seth(120)
t.circle(40, 220)
t.penup() #画右耳朵
t.goto(50, 100 + 50 * (3**0.5))
t.pendown()
t.seth(60)
t.circle(-40, 220)
t.penup() #画右手臂
t.goto(20, 0)
t.seth(0)
t.pendown()
t.circle(-200, 40)
t.circle(-50, 120)
t.penup() #画左手臂
t.goto(-20, 0)
t.seth(180)
t.pendown()
t.circle(200, 40)
t.circle(50, 120)
#画右眼睛
t.penup()
t.goto(40, 140)
t.seth(0)
t.pendown()
t.begin_fill()
t.fillcolor("pink")
t.circle(-15)
t.end_fill()
#画左眼睛
t.penup()
t.goto(-40, 140)
t.seth(180)
t.pendown()
t.begin_fill()
t.circle(15)
t.end_fill()
#画嘴巴
t.penup()
t.goto(-25, 80)
t.seth(0)
t.pendown()
t.fd(50)
t.penup()
t.goto(25, 80)
t.seth(-90)
t.pendown()
t.circle(-25, 180)
#画扣子
t.penup()
t.fillcolor("green")
t.goto(0, -60)
t.pendown()
t.begin_fill()
t.circle(8)
t.end_fill()
t.penup()
t.goto(0, -130)
t.pendown()
t.begin_fill()
t.circle(8)
t.end_fill()
t.penup()
t.goto(0, -200)
t.pendown()
t.begin_fill()
t.circle(8)
t.end_fill()
t.done()

#实现效果图如下:

s


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值