大家好,给大家分享一下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()