python做简单的笑脸的编程,python画简单笑脸代码

本篇文章给大家谈谈python画笑脸步骤的中文翻译,以及python做简单的笑脸的编程,希望对各位有所帮助,不要忘了收藏本站喔。

Source code download: 本文相关源码

page-header-to-2021-08-21.jpg

我就废话不多说了,直接上代码吧!

import turtle

turtle.pensize(5)

turtle.pencolor("yellow")

turtle.fillcolor("red")

turtle.penup()

turtle.goto(0,-200)

turtle.pendown()

turtle.circle(200)

turtle.penup()

turtle.goto(-100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(0,50)

turtle.pendown()

turtle.circle(-70,steps=3)

turtle.penup()

turtle.goto(-100,-70)

turtle.pendown()

turtle.right(90)

turtle.circle(100,180)

turtle.mainloop()#结果如下

45uxxnfkvhn.jpg

import turtle

turtle.pensize(5)

turtle.pencolor("green")

turtle.fillcolor("red")

turtle.penup()

turtle.goto(0,-200)

turtle.pendown()

turtle.circle(200)

turtle.penup()

turtle.goto(-100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(0,50)

turtle.pendown()

turtle.circle(-70,steps=3)

turtle.penup()

turtle.goto(-50,-120)

turtle.pendown()

turtle.left(90)

turtle.circle(-50,180)

turtle.mainloop()#结果如下

gr1ff21obsb.jpg

import turtle

turtle.pensize(5)

turtle.pencolor("green")

turtle.fillcolor("red")

turtle.penup()

turtle.goto(0,-200)

turtle.pendown()

turtle.circle(200)

turtle.penup()

turtle.goto(-100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(100,50)

turtle.pendown()

turtle.begin_fill()

turtle.circle(17.5)

turtle.end_fill()

turtle.penup()

turtle.goto(0,50)

turtle.pendown()

turtle.circle(-70,steps=3)

turtle.penup()

turtle.goto(-100,-120)

turtle.pendown()

turtle.left(90)

turtle.circle(-25,180)

turtle.left(180)

turtle.circle(-25,180)

turtle.left(180)

turtle.circle(-25,180)

turtle.left(180)

turtle.circle(-25,180)

turtle.mainloop()#结果如下

qrkaxzo1qjn.jpg

以上这篇python 利用turtle库绘制笑脸和哭脸的例子就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

page-footer-to-2021-08-21.jpg

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值