当前位置:   article > 正文

python实现画图画猪_python画猪猪侠

python画猪猪侠

实现效果
在这里插入图片描述

代码如下

#导入turtle库
import turtle
#导入turtle画笔
turtle.shape('turtle')
# turtle.speed(0)
turtle.pencolor('pink')#线条的颜色
length = 150;#定义变量
x = 70;
y = 220;
#面部
turtle.fillcolor('pink')#填充颜色为粉色
turtle.begin_fill()#代码开始填充的地方

#绘制一个length为150的圆。也就是圆的半径为150
turtle.circle(length)

turtle.end_fill()# 代码结束填充的地方
#耳朵
turtle.penup()
turtle.goto(-130,220)
turtle.pendown()
turtle.fillcolor('pink')
turtle.begin_fill()
turtle.circle(40)
turtle.end_fill()

turtle.penup()
turtle.goto(130
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/198663
推荐阅读
相关标签
  

闽ICP备14008679号