turtle模块
作者:
陨星落云 | 来源:发表于
2019-02-13 19:06 被阅读8次def draw_square(some_turtle):
#循环
for i in range(1,5):
some_turtle.forward(100)
some_turtle.right(90)
def draw_art():
window=turtle.Screen()#创建窗口
window.bgcolor("yellow")
#
brad = turtle.Turtle()#创建实例
brad.shape("arrow")#形状(turtle、square、arrow、circle)
brad.color("green")#颜色
brad.speed(10)#速度
for i in range(1,37):
draw_square(brad)
brad.right(10)
#
angie=turtle.Turtle()
angie.shape("circle")
angie.color("blue")
angie.circle(100)
draw_art()
QQ截图20190213190553.jpg
本文标题:turtle模块
本文链接:https://www.haomeiwen.com/subject/lhtjeqtx.html
网友评论