这篇文章主要介绍了python画笑脸步骤的中文翻译,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。
Source code download: 本文相关源码
生活百般滋味,人生需要笑对
上上上代码!!!!
import turtle as t
import random
t.screensize(bg='pink')#背景颜色
t.setup(900,800)
t.speed(20)
t.penup()
t.goto(0,-100)
t.pendown()
t.begin_fill()
t.color('orange')
t.circle(180)
t.end_fill()
t.begin_fill()
t.color('yellow')
t.penup()
t.goto(0,-90)
t.pendown()
t.circle(170)
t.end_fill()
t.penup()
t.goto(-50,150)
t.pendown()
t.left(90)
t.pensize(3)
t.pencolor('black')
t.circle(40,180)
t.left(180)
t.penup()
t.goto(120,150)
t.pendown()
t.circle(40,180)
t.penup()
t.goto(-120,80)
t.pendown()
t.circle(120,180)
t.penup()
t.right(90)
t.penup()
t.goto(-140,115)
t.pendown()
t.pensize(25)
t.pencolor('pink')
t.forward(40)
t.penup()
t.goto(100,115)
t.pendown()
t.pensize(25)
t.pencolor('pink')
t.forward(40)
t.hideturtle()