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

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()#结果如下

python 利用turtle库绘制笑脸和哭脸的例子

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()#结果如下

python 利用turtle库绘制笑脸和哭脸的例子

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()#结果如下

python 利用turtle库绘制笑脸和哭脸的例子

以上这篇python 利用turtle库绘制笑脸和哭脸的例子就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

标签:
python,turtle,笑脸,哭脸

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com