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)
相关推荐
xchenhao1 小时前
SciKit-Learn 全面分析分类任务 breast_cancer 数据集
python·机器学习·分类·数据集·scikit-learn·svm
独行soc4 小时前
2025年渗透测试面试题总结-66(题目+回答)
java·网络·python·安全·web安全·adb·渗透测试
Y学院6 小时前
Python 数据分析:从新手到高手的“摸鱼”指南
python·数据分析
深耕AI7 小时前
【PyTorch训练】准确率计算(代码片段拆解)
人工智能·pytorch·python
eqwaak07 小时前
科技信息差(9.12)
开发语言·python·科技·量子计算
Blossom.1187 小时前
从“能写”到“能干活”:大模型工具调用(Function-Calling)的工程化落地指南
数据库·人工智能·python·深度学习·机器学习·计算机视觉·oracle
蒋星熠8 小时前
破壁者指南:内网穿透技术的深度解构与实战方法
网络·数据库·redis·python·websocket·网络协议·udp
shizidushu8 小时前
使用 Pyinstaller 打包 PPOCRLabel
python·pyinstaller
Q_Q19632884758 小时前
python+springboot+uniapp微信小程序题库系统 在线答题 题目分类 错题本管理 学习记录查询系统
spring boot·python·django·uni-app·node.js·php