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)
相关推荐
kida_yuan15 小时前
【从零开始】12. 一切回归原点
python·架构·nlp
大翻哥哥16 小时前
Python 2025:AI工程化与智能代理开发实战
开发语言·人工智能·python
站大爷IP16 小时前
Python文件处理:从基础操作到实战技巧全解析
python
再努力"亿"点点16 小时前
Sklearn(机器学习)实战:鸢尾花数据集处理技巧
开发语言·python
费弗里17 小时前
无需云服务器!通过Plotly Cloud免费快捷部署Dash应用
python·dash
跟橙姐学代码17 小时前
轻松搞定 Python 模块与包导入:新手也能秒懂的入门指南
前端·python·ipython
荏苒追寻17 小时前
Python 爬虫——爬虫基础
python
wdfk_prog17 小时前
Python脚本深度解析:实现基于YMODEM的单片机固件自动化升级
python·单片机·自动化
萧鼎18 小时前
深入解析 Python 的 pytun 库:虚拟网络接口与隧道技术实战指南
服务器·网络·python
西猫雷婶18 小时前
pytorch基本运算-分离计算
人工智能·pytorch·python·深度学习·神经网络·机器学习