ICode国际青少年编程竞赛- Python-1级训练场-for循环入门

ICode国际青少年编程竞赛- Python-1级训练场-for循环入门

1、

python 复制代码
for i in range(4):
    Dev.step(4)
    Dev.turnLeft()

2、

python 复制代码
for i in range(3):
    Dev.step(6)
    Dev.turnRight()

3、

python 复制代码
for i in range(3):
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(-3)

4、

python 复制代码
for i in range(4):
    Dev.step(4)
    Dev.step(-4)
    Dev.turnLeft()

5、

python 复制代码
for i in range(5):
    Dev.step(2)
    Dev.turnRight()
    Dev.step(4)
    Dev.step(-4)
    Dev.turnLeft()

6、

python 复制代码
for i in range(4):
    Dev.step(5)
    Dev.step(-5)
    Dev.turnRight()

7、

python 复制代码
for i in range(3):
    Dev.turnLeft()
    Dev.step(1)
    Dev.turnRight()
    Dev.step(-3)

8、

python 复制代码
for i in range(4):
    Dev.step(6)
    Dev.step(-6)
    Dev.turnLeft()
    Dev.step(-3)
    Dev.turnRight()

9、

python 复制代码
Dev.turnLeft()
for i in range(3):
    Spaceship.step(2)
    Dev.step(4)
    Dev.step(-8)
    Dev.step(4)

10、

python 复制代码
Dev.turnLeft()
for i in range(3):
    Spaceship.step(2)
    Dev.step(4)
    Dev.step(-6)
    Dev.step(2)

11、

python 复制代码
Dev.step(1)
for i in range(3):
    Spaceship.step(6)
    Spaceship.turnLeft()

12、

python 复制代码
for i in range(3):
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(3)
    Spaceship.turnRight()

13、

python 复制代码
for i in range(3):
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(3)
    Spaceship.turnRight()

14、

python 复制代码
for i in range(4):
    Spaceship.step(5)
    Spaceship.turnRight()
    Spaceship.turnRight()
    Spaceship.step(5)
    Spaceship.turnRight()

15、

python 复制代码
Spaceship.step(1)
Dev.step(1)
for i in range(3):
    Spaceship.turnRight()
    Spaceship.step(4)
Dev.step(1)

16、

python 复制代码
for i in range(3):
    Spaceship.step(3)
    Dev.step(2)
    Dev.step(-4)
    Dev.step(2)

17、

python 复制代码
for i in range(4):
    Spaceship.step(2)
    for i in range(2):
        Spaceship.turnLeft()
        Spaceship.step(5)
        Spaceship.turnLeft()

18、

python 复制代码
for i in range(4):
    Spaceship.step(5)
    Spaceship.turnRight()
    Spaceship.turnRight()
    Spaceship.step(5)
    Spaceship.turnRight()

19、

python 复制代码
for i in range(4):
    Spaceship.step(1)
    Spaceship.turnLeft()
    Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    Spaceship.step(6)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    Spaceship.step(4)
    Spaceship.turnRight()
    Spaceship.step(2)

20、

python 复制代码
Dev.step(2)
for i in range(3):
    Spaceship.step(2)
    Dev.step(2)
    Dev.step(-2)
相关推荐
鸿业远图科技1 小时前
分式注记种表达方式arcgis
python·arcgis
别让别人觉得你做不到2 小时前
Python(1) 做一个随机数的游戏
python
小彭律师3 小时前
人脸识别门禁系统技术文档
python
张小九995 小时前
PyTorch的dataloader制作自定义数据集
人工智能·pytorch·python
zstar-_5 小时前
FreeTex v0.2.0:功能升级/支持Mac
人工智能·python·macos·llm
苏生要努力5 小时前
第九届御网杯网络安全大赛初赛WP
linux·python·网络安全
于壮士hoho5 小时前
DeepSeek | AI需求分析
人工智能·python·ai·需求分析·dash
蒙奇D索大5 小时前
【人工智能】自然语言编程革命:腾讯云CodeBuddy实战5步搭建客户管理系统,效率飙升90%
人工智能·python·django·云计算·腾讯云
AndrewHZ5 小时前
【Python生活】如何构建一个跌倒检测的算法?
python·算法·生活·可视化分析·陀螺仪·加速度计·跌倒检测
lizz6665 小时前
Python查询ES错误ApiError(406, ‘Content-Type ...is not supported
python·elasticsearch