中文字幕精品无码一区二区,成全视频在线播放观看方法,大伊人青草狠狠久久,亚洲一区影音先锋色资源

【少兒編程】7 列表的遍歷 課件(共14張PPT)

資源下載
  1. 二一教育資源

【少兒編程】7 列表的遍歷 課件(共14張PPT)

資源簡介

(共14張PPT)
列表的遍歷
作業解析
Dev.step(2)
Dev.turnRight()
Dev.step(4)
Dev.step(-2)
Spaceship.step(2)
Dev.turnLeft()
Dev.step(2)
Dev.turnLeft()
Dev.step(2)
Ex-5
作業解析
for i in range(3):
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
Dev.step(2)
Ex-8
作業解析
Dev.turnLeft()
for i in range(3):
Spaceship.step(2)
Dev.step(2)
Dev.step(-3)
Dev.step(1)
Spaceship.step(1)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Ex-11
作業解析
for i in range(4):
Spaceship.step(3)
Dev.step(2)
Dev.step(-2)
Spaceship.turnRight()
Spaceship.step(1)
Dev.turnRight()
Dev.step(2)
Dev.step(-2)
Spaceship.turnLeft()
Spaceship.step(4)
Spaceship.turnRight()
Spaceship.step(3)
Ex-14
進行4次循環
講授新課
Flyer[0]
Flyer[1]
Flyer[6]
多個飛板都叫Flyer,Flyer就是一個列表,例如Flyer[0]、Flyer[1],其中0和1就是索引值,可以理解為編號,通過編號可以找到對應的飛板
通過for循環可以遍歷,即從頭到尾依次從列表中獲取所有的飛板,用變量i來表示Flyer的索引值
for i in range(7):
Flyer[i].step(1)
Dev.step(8)
講授新課
Flyer[0]
Flyer[1]
Flyer[2]
Flyer[7]
Flyer[6]
for i in range(8):
Flyer[i].step(3)
for j in range(4):
Dev.turnLeft()
Dev.step(3)
Dev.step(-6)
Dev.step(3)
Dev.turnRight()
Dev.step(4)
使用變量i索引所有飛盤
Dev行走路線的規律
基礎訓練2 Ex-7
講授新知
for循環中變量i可以做加減乘除運算,例如這一題中,只有索引值為0-2-4的飛板需要移動,變化可以用(i*2)表示
for i in range(3):
Flyer[i*2].step(1)
Dev.turnRight()
Dev.step(9)
Flyer[0]
Flyer[2]
Flyer[4]
課堂練習
當飛板的移動步數出現變化時,可以應用變量表示飛板的移動步數
請把下面的代碼,補充完整,完成收集任務
a=8
for i in range(4):
Flyer[i].step(a)
a=a/2
Dev.step(8)
Flyer[0]
Flyer[3]
課堂練習
基礎訓練2 Ex-10
Flyer[0]
Flyer[1]
Flyer[2]
Flyer[3]
for i in range(4):
Flyer[i].step(1)
for i in range(6):
if i%2==0:Dev.turnRight()
if i%2==1:Dev.turnLeft()
Dev.step(2)
課堂練習
for i in range(3):
Flyer[i].step(i+1)
Dev.step(6)
Flyer[0]
Flyer[1]
Flyer[2]
課堂練習
for i in range(4):
Flyer[i].step(2)
Dev.step(2)
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
Dev.step(3)
Dev.turnLeft()
Dev.step(1)
Dev.turnRight()
Dev.step(1)
練習鞏固
完成訓練20~30題
課后作業
完成第30~40題。
要求:周日晚8點前,將“我的成績”截圖上傳至編程園地scls-one.ysepan.com。

展開更多......

收起↑

資源預覽

<pre id="tfb94"><li id="tfb94"></li></pre>

<bdo id="tfb94"><rt id="tfb94"></rt></bdo>
  • <menu id="tfb94"><dl id="tfb94"></dl></menu><i id="tfb94"><acronym id="tfb94"><sub id="tfb94"></sub></acronym></i>

    1. 主站蜘蛛池模板: 卫辉市| 丰原市| 耿马| 万年县| 乌兰县| 大洼县| 抚远县| 巨野县| 平顶山市| 乌苏市| 措勤县| 涟源市| 岢岚县| 兴安县| 鄂托克旗| 元谋县| 江都市| 且末县| 柏乡县| 来凤县| 策勒县| 延寿县| 三明市| 安义县| 南乐县| 郴州市| 汶上县| 砀山县| 海城市| 新竹市| 西林县| 建德市| 长顺县| 武穴市| 昌图县| 聊城市| 平武县| 广安市| 板桥市| 张北县| 衡水市|