#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( )
转载于:https://www.cnblogs.com/Wang-Y/p/8894053.html