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

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

1、

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

2、

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

3、

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

4、

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

5、

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

6、

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

7、

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

8、

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

9、

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

10、

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

11、

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

12、

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

13、

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

14、

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

15、

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

16、

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

17、

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

18、

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

19、

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

20、

python 复制代码
Dev.step(-1)
for i in range(4):
    Spaceship.step(1)
    Spaceship.turnRight()
    Spaceship.step(3)
Dev.step(-3)
for i in range(2):
    Dev.turnRight()
    Dev.step(-2)
相关推荐
bj_zhb16 小时前
图片的base64表示
python·llm
飞Link16 小时前
【Django】Django 调用外部 Python 程序的完整指南
后端·python·django·sqlite
周杰伦_Jay16 小时前
【Java集合与线程池深度解析】底层原理+实战选型+避坑指南(附代码)
java·开发语言·python
一人の梅雨17 小时前
淘宝关键字搜索接口深度解析:从动态策略适配到商业数据重构
python·重构
道199317 小时前
PyTorch 从小白到高级进阶教程[工业级示例](三)
人工智能·pytorch·python
测试人社区-千羽17 小时前
智能测试的终极形态:从自动化到自主化的范式变革
运维·人工智能·python·opencv·测试工具·自动化·开源软件
锐学AI17 小时前
从零开始学MCP(八)- 构建一个MCP server
人工智能·python
木棉知行者17 小时前
PyTorch 核心方法:state_dict ()、parameters () 参数打印与应用
人工智能·pytorch·python
xingzhemengyou117 小时前
python time的使用
python
码界奇点17 小时前
基于Python与GitHub Actions的正方教务成绩自动推送系统设计与实现
开发语言·python·车载系统·自动化·毕业设计·github·源代码管理