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

发布于:2024-05-05 ⋅ 阅读:(32) ⋅ 点赞:(0)

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

1、
在这里插入图片描述

a = 4
Dev.turnRight()
Dev.step(a)

2、
在这里插入图片描述

a = 4
Spaceship.step(a)
Dev.step(a)

3、
在这里插入图片描述

a = 4
Dev.step(a)
Dev.turnLeft()
Dev.step(a)

4、

在这里插入图片描述

a = 5
Dev.step(a)
Spaceship.step(a)
Dev.step(a)

5、

在这里插入图片描述

a = 3
Dev.step(a)
Dev.turnLeft()
Spaceship.step(a)
Dev.step(a)
Dev.turnRight()
Dev.step(a)
Dev.turnLeft()
Dev.step(a)

6、
在这里插入图片描述

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

7、
在这里插入图片描述

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

8、
在这里插入图片描述

a = 2
Spaceship.step(a)
Spaceship.turnRight()

Dev.step(a)

Spaceship.step(a)
for i in range(3):
    Dev.turnLeft()
    Dev.step(a)

9、
在这里插入图片描述

a = 3
Dev.step(a)
Dev.turnRight()
a = a + 1
Dev.step(a)

10、
在这里插入图片描述

a = 5
Spaceship.step(a)
a = a - 1
Dev.step(a)

11、
在这里插入图片描述

a = 2 
Dev.step(a)
Spaceship.step(a)
a = a + 1
Dev.step(a)

12、
在这里插入图片描述

a = 4
Dev.step(a)
Dev.step(-a)
Dev.turnRight()
Dev.step(-a)

13、
在这里插入图片描述

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

14、
在这里插入图片描述

a = 2
Spaceship.step(a)
Dev.step(2 * a)

15、
在这里插入图片描述

a = 2
Dev.step(a)
a = a * 2
Spaceship.step(a)
a = a * 2
Dev.step(a)

16、
在这里插入图片描述

a = 6
Dev.step(a)
Spaceship.step(a / 2)

17、
在这里插入图片描述

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

18、
在这里插入图片描述

a = 2
Dev.step(-a)
Spaceship.step(2 * a)
Dev.step(a)

19、
在这里插入图片描述

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、
在这里插入图片描述

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()