turtle库画超立方体 难度1

#turtle库画超立方体

import turtle

#初始化起点
turtle.penup( )
turtle.goto( -50 , 25 )
turtle.pendown( )

#画一部分,重复8次
for i in range(8):
    turtle.color("purple")
    turtle.forward( 100 )
    turtle.left( 90 )
    turtle.color("green")
    turtle.forward( 100 )
    turtle.color("blue")
    turtle.right( 135 )
    turtle.forward( 100 )
    turtle.right( 45 )
    turtle.forward( 100 )
    turtle.color("green")
    turtle.right( 135 )
    turtle.forward( 100 )
    turtle.left( 90 )



#使页面持续显示
turtle.done( )

posted @ 2018-04-20 23:02  WY~记录  阅读(426)  评论(0编辑  收藏  举报