用python画皮卡丘的代码-利用Python绘制萌萌哒的皮卡丘

这篇博客介绍了如何使用Python的turtle模块来绘制可爱的皮卡丘。通过定义不同的函数,如drawNose()、drawEyes()、drawFace()和drawLip(),详细讲解了皮卡丘各部位的绘制步骤,包括鼻子、眼睛、脸部和嘴巴。最终在主函数中调用这些函数,生成一个完整的皮卡丘图像。
摘要由CSDN通过智能技术生成

"""Python学习交流群:960410445"""

importturtle#画鼻子

defdrawNose():

turtle.penup()

turtle.seth(90)

turtle.fd(100)

turtle.pendown()

turtle.begin_fill()

turtle.fillcolor("black")

turtle.seth(45)

turtle.fd(25)

turtle.seth(135)

turtle.circle(25, 95)

turtle.seth(315)

turtle.fd(25)

turtle.end_fill()#画眼睛

defdrawEyes(seth, fd, r):

turtle.penup()

turtle.seth(seth)

turtle.fd(fd)

turtle.pendown()

turtle.begin_fill()

turtle.fillcolor("black")

turtle.circle(50)

turtle.end_fill()

turtle.penup()

turtle.circle(50, r)

turtle.pendown()

turtle.begin_fill()

turtle.fillcolor("white")

turtle.circle(20)

turtle.end_fill()#画脸

defdrawFace(seth, fd):

turtle.penup()

turtle.seth(seth)

turtl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值