ICode国际青少年编程竞赛- Python-1级训练场-变量入门

embedded/2024/10/11 13:26:03/

ICode国际青少年编程竞赛- Python-1级训练场-变量入门

1、
在这里插入图片描述

python">a = 4
Dev.turnRight()
Dev.step(a)

2、
在这里插入图片描述

python">a = 4
Spaceship.step(a)
Dev.step(a)

3、
在这里插入图片描述

python">a = 4
Dev.step(a)
Dev.turnLeft()
Dev.step(a)

4、

在这里插入图片描述

python">a = 5
Dev.step(a)
Spaceship.step(a)
Dev.step(a)

5、

在这里插入图片描述

python">a = 3
Dev.step(a)
Dev.turnLeft()
Spaceship.step(a)
Dev.step(a)
Dev.turnRight()
Dev.step(a)
Dev.turnLeft()
Dev.step(a)

6、
在这里插入图片描述

python">a = 3
for i in range(a):Dev.turnRight()Dev.step(a)

7、
在这里插入图片描述

python">v = 2
for i in range(3):Dev.turnLeft()Dev.step(v)Dev.turnRight()Dev.step(v)

8、
在这里插入图片描述

python">a = 2
Spaceship.step(a)
Spaceship.turnRight()Dev.step(a)Spaceship.step(a)
for i in range(3):Dev.turnLeft()Dev.step(a)

9、
在这里插入图片描述

python">a = 3
Dev.step(a)
Dev.turnRight()
a = a + 1
Dev.step(a)

10、
在这里插入图片描述

python">a = 5
Spaceship.step(a)
a = a - 1
Dev.step(a)

11、
在这里插入图片描述

python">a = 2 
Dev.step(a)
Spaceship.step(a)
a = a + 1
Dev.step(a)

12、
在这里插入图片描述

python">a = 4
Dev.step(a)
Dev.step(-a)
Dev.turnRight()
Dev.step(-a)

13、
在这里插入图片描述

python">a = 3
Dev.step(a)
Dev.turnLeft()
Dev.step(a)
Dev.step(-2 * a)

14、
在这里插入图片描述

python">a = 2
Spaceship.step(a)
Dev.step(2 * a)

15、
在这里插入图片描述

python">a = 2
Dev.step(a)
a = a * 2
Spaceship.step(a)
a = a * 2
Dev.step(a)

16、
在这里插入图片描述

python">a = 6
Dev.step(a)
Spaceship.step(a / 2)

17、
在这里插入图片描述

python">a = 2
Dev.step(2 * a)
Dev.turnRight()
Dev.step(a)
Dev.turnLeft()
Dev.step(a / 2)

18、
在这里插入图片描述

python">a = 2
Dev.step(-a)
Spaceship.step(2 * a)
Dev.step(a)

19、
在这里插入图片描述

python">a = 2
for i in range(3):Dev.step(a)Dev.turnLeft()
Spaceship.step(a)
for i in range(4):Dev.step(-a * 2)Dev.turnRight()

20、
在这里插入图片描述

python">a = 2
for i in range(3):Dev.step(a)Dev.turnRight()Dev.step(a)Dev.turnLeft()
Spaceship.step(a)
Dev.step(-a)
for i in range(3):Dev.step(-a - 1)Dev.turnLeft()

http://www.ppmy.cn/embedded/33566.html

相关文章

2G 3G LTE 5G的区别

2G、3G、LTE和5G是不同代的移动通信技术,每一代技术都在其前一代的基础上提供了改进的性能、更高的数据速率和新的功能。以下是这些技术的主要区别: ### 2G (第二代移动通信技术): - **数据速率**:较低的数据速率,通常在几百kbps…

Meditron:基于 Llama 完全开源的医学大语言模型

健康危机就在眼前,当医疗资源有限时,每一秒钟都至关重要!Meditron 就像一位忠实的医疗助手,提供基于证据的护理建议和情境意识的推荐,帮助医疗工作者在诊断和治疗过程中做出更准确的决策。 在资源有限的医疗环境中&am…

tensorflow可以使用GPU,而torch无法使用GPU

具有conda测试环境无意使用pip更新了tensorflow后,导致总报提示“could not load dynamic library ‘libnvinfer.so.7’”,经过查询后建议pip uninstall tensorflow后使用conda安装。 conda install tensorflow后解决了库动态加载问题,但是t…

【SQL基础】mysql中如何将日期时间类型转换为日期类型

在MySQL中,将DATETIME类型的数据转换为日期格式可以通过使用DATE()函数来实现。DATE()函数可以从DATETIME或TIMESTAMP类型的值中提取出日期部分。 以下是几种将DATETIME转换为日期格式的示例: 直接转换DATETIME列为日期: SELECT DATE(date…

C#面:简述 C# 种索引器实现过程,是否只能根据数字索引

C# 中的索引器(Indexer)是一种特殊的属性,它允许对象像数组一样通过索引来访问其元素。索引器可以用于访问类、结构体或接口中的元素,使得对象可以像数组一样进行索引操作。 可以通过任意类型进行索引。 索引器的实现过程如下&am…

Android C++ 开发调试 LLDB 工具的使用

文章目录 调试环境准备基础命令Breakpoint CommandsWatchpoint CommandsExamining VariablesEvaluating ExpressionsExamining Thread StateExecutable and Shared Library Query Commands 参考: Android 中在进行 NDK 开发的时候,我们经常需要进行 C 代…

openjudge_2.5基本算法之搜索_2152:Pots

题目 2152:Pots 总时间限制: 1000ms 内存限制: 65536kB 描述 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty the pot i to the…

QT:QT与操作系统

文章目录 信号槽与事件QT多线程概述原理完成倒计时程序 UDP回显服务器服务端客户端 信号槽与事件 在之前的信号槽中,已经有了一个基本的认识,那么对于QT中事件的理解其实就非常的类似,当用户进行某种操作的时候,就会触发事件&…