一、多啦A梦-笔记
二、代码
1.多啦A梦
import turtle as t
#设置背景颜色
t.bgcolor('black')
#速度设置
# t.speed(0)
#设置画笔形状 为 海龟
t.shape('turtle')
#1.脸
t.color('white', 'blue')
t.begin_fill() #开始填充
t.circle(100)
t.end_fill() #结束填充
t.fillcolor('white') #修改填充颜色为 white
t.begin_fill()
t.circle(80)
t.end_fill()
#2.眼眶
t.color('black') #画笔颜色,填充颜色 都是 black
t.penup() #抬笔
t.goto(0,150) #定位(x,y)
t.pendown() #落笔
t.right(90) #右转 朝下
#右边眼眶
t.fillcolor('white')
t.begin_fill()
t.circle(20)
#左边眼眶
t.circle(-20)
t.end_fill()
#3.眼珠子
t.color('black') #笔颜色,填充颜色 都是 black
t.begin_fill() #画图前 开始填充
t.circle(10) #左边 眼珠子
t.circle(-10) #右边 眼珠子
t.end_fill() #画图后 结束填充
#4.鼻子 #速度:speed(0) 0最快,1-10数字越大越快
t.penup()
t.goto(-10,110) #定位 鼻子位置
t.pendown()
t.color('red')
t.begin_fill()
t.circle(10) #自己 填充鼻子颜色
t.end_fill()
#5.嘴巴
t.penup()
t.goto(-30,60) #定位 嘴巴子位置
t.pendown()
t.circle(30,180)
#隐藏海龟
t.hideturtle() #画完图后 把海龟隐藏
t.done()