儿童编程与艺术趣Python

Python turtle 画个大白

2019-03-21  本文已影响3人  一石匠人

今天用Python Turtle画个大白吧。效果图如下:


Python画大白
def bai():
       #tracer(False)
       speed(0)
       pensize(5)
       color('black','white')
       penup()
       goto(-90,-30)
       pendown()
       begin_fill()
       circle(30)
       end_fill()
       penup()
       goto(90,-30)
       pendown()
       begin_fill()
       circle(30)
       end_fill()
       penup()
       goto(-65,-170)
       pendown()
       begin_fill()
       circle(40)
       end_fill()
       penup()
       goto(65,-170)
       pendown()
       begin_fill()
       circle(40)
       end_fill()
       penup()
       goto(0,-150)
       pendown()
       begin_fill()
       circle(100)
       end_fill()
       penup()
       goto(0,0)
       pendown()
       begin_fill()
       circle(60)
       end_fill()
       penup()
       goto(-32,45)
       right(90)
       color('black','black')
       begin_fill()
       circle(8)
       end_fill()
       left(90)
       goto(25,45)
       right(90)
       begin_fill()
       circle(8)
       end_fill()
       goto(-50,-230)
上一篇下一篇

猜你喜欢

热点阅读