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)
相关推荐
哆啦A梦的口袋呀1 分钟前
基于Python学习《Head First设计模式》第九章 迭代器和组合模式
python·学习·设计模式
sponge'21 分钟前
opencv学习笔记2:卷积、均值滤波、中值滤波
笔记·python·opencv·学习
databook1 小时前
概率图模型:机器学习的结构化概率之道
python·机器学习·scikit-learn
拾回程序猿的圈圈∞1 小时前
实战二:开发网页端界面完成黑白视频转为彩色视频
python·ai编程
亚林瓜子1 小时前
AWS Elastic Beanstalk + CodePipeline(Python Flask Web的国区CI/CD)
python·ci/cd·flask·web·aws·beanstalk·codepipeline
春末的南方城市1 小时前
中山大学&美团&港科大提出首个音频驱动多人对话视频生成MultiTalk,输入一个音频和提示,即可生成对应唇部、音频交互视频。
人工智能·python·深度学习·计算机视觉·transformer
深科文库2 小时前
构建 MCP 服务器:第 4 部分 — 创建工具
python·chatgpt·prompt·aigc·agi·ai-native
witton2 小时前
美化显示LLDB调试的数据结构
数据结构·python·lldb·美化·debugger·mupdf·pretty printer
nenchoumi31193 小时前
AirSim/Cosys-AirSim 游戏开发(一)XBox 手柄 Windows + python 连接与读取
windows·python·xbox
GoodStudyAndDayDayUp3 小时前
初入 python Django 框架总结
数据库·python·django