資源簡介 (共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/同 學 們 再 見 ! 展開更多...... 收起↑ 資源預覽 縮略圖、資源來源于二一教育資源庫