资源简介 (共13张PPT)福列表02CONTENTS1指令记忆problems问题引入小海龟是怎么画出不连续的线段的?海龟先直走;然后抬笔,再直走;落笔,直走,重复几次就可以形成了不连续线段(虚线)02CONTENTS2实 例 演 示import turtle as tt.goto(0,0)t.speed(0)t.delay(0)t.pendown()anglelist=[30,60,90,120,150,180]colorlist=["red","orange","yellow", "green","blue","purple"]for i in range(180):t.forward(i)t.pencolor(colorlist[i%6])t.left(anglelist[1])import turtleturtle.speed(0)turtle.delay(0)# Set up the turtle screenturtle.bgcolor("black")turtle.title("Dynamic Design with 东辰")# Function to draw a dynamic patterndef draw_dynamic_pattern():colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]for _ in range(72):turtle.pencolor(colors[_ % len(colors)])turtle.forward(_)turtle.right(45)# Draw the dynamic patterndraw_dynamic_pattern()# Move turtle to a new position to write "东辰"turtle.penup()turtle.goto(-20, -50)turtle.pendown()turtle.color("white")turtle.write("东辰", font=("Arial", 16, "bold"))# Hide the turtleturtle.hideturtle()# Keep the window openturtle.done()02CONTENTS4小 码 当 家1取余的认识样例网址:http://maker./python/同 学 们 再 见 ! 展开更多...... 收起↑ 资源预览