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)
相关推荐
青瓷程序设计1 小时前
动物识别系统【最新版】Python+TensorFlow+Vue3+Django+人工智能+深度学习+卷积神经网络算法
人工智能·python·深度学习
tobebetter95271 小时前
How to manage python versions on windows
开发语言·windows·python
F_D_Z2 小时前
数据集相关类代码回顾理解 | sns.distplot\%matplotlib inline\sns.scatterplot
python·深度学习·matplotlib
daidaidaiyu2 小时前
一文入门 LangGraph 开发
python·ai
不知更鸟3 小时前
前端报错:快速解决Django接口404问题
前端·python·django
4***72133 小时前
【玩转全栈】----Django模板语法、请求与响应
数据库·python·django
梁正雄4 小时前
1、python基础语法
开发语言·python
ituff5 小时前
微软认证考试又免费了
后端·python·flask
梁正雄6 小时前
2、Python流程控制
开发语言·python
Eric.Lee20217 小时前
ubuntu 安装 Miniconda
linux·运维·python·ubuntu·miniconda