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)
相关推荐
心情好的小球藻16 分钟前
Python应用进阶DAY9--类型注解Type Hinting
开发语言·python
都叫我大帅哥17 分钟前
LangChain加载HTML内容全攻略:从入门到精通
python·langchain
惜.己27 分钟前
使用python读取json数据,简单的处理成元组数组
开发语言·python·测试工具·json
都叫我大帅哥2 小时前
Python的Optional:让你的代码优雅处理“空值”危机
python
曾几何时`4 小时前
基于python和neo4j构建知识图谱医药问答系统
python·知识图谱·neo4j
写写闲篇儿6 小时前
Python+MongoDB高效开发组合
linux·python·mongodb
杭州杭州杭州7 小时前
Python笔记
开发语言·笔记·python
路人蛃9 小时前
通过国内扣子(Coze)搭建智能体并接入discord机器人
人工智能·python·ubuntu·ai·aigc·个人开发
qiqiqi(^_×)9 小时前
卡在“pycharm正在创建帮助程序目录”
ide·python·pycharm
Ching·9 小时前
esp32使用ESP-IDF在Linux下的升级步骤,和遇到的坑Traceback (most recent call last):,及解决
linux·python·esp32·esp_idf升级