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)
相关推荐
橘子编程8 分钟前
Python-Word文档、PPT、PDF以及Pillow处理图像详解
开发语言·python
蓝婷儿23 分钟前
Python 机器学习核心入门与实战进阶 Day 2 - KNN(K-近邻算法)分类实战与调参
python·机器学习·近邻算法
之歆1 小时前
Python-封装和解构-set及操作-字典及操作-解析式生成器-内建函数迭代器-学习笔记
笔记·python·学习
天天爱吃肉82182 小时前
ZigBee通信技术全解析:从协议栈到底层实现,全方位解读物联网核心无线技术
python·嵌入式硬件·物联网·servlet
Allen_LVyingbo2 小时前
Python常用医疗AI库以及案例解析(2025年版、上)
开发语言·人工智能·python·学习·健康医疗
智能砖头2 小时前
LangChain 与 LlamaIndex 深度对比与选型指南
人工智能·python
风逸hhh4 小时前
python打卡day58@浙大疏锦行
开发语言·python
烛阴5 小时前
一文搞懂 Python 闭包:让你的代码瞬间“高级”起来!
前端·python
JosieBook5 小时前
【Java编程动手学】Java中的数组与集合
java·开发语言·python
Gyoku Mint6 小时前
深度学习×第4卷:Pytorch实战——她第一次用张量去拟合你的轨迹
人工智能·pytorch·python·深度学习·神经网络·算法·聚类