青少年软件编程(Python一级)等级考试试卷(2022年9月)
0
True
False
1
None
True
Error
False
语法错误
turtle.goto(x,y)可以让小海龟直线前进到指定的坐标位置。
turtle.forward(a)可以让小海龟向前移动a个像素,如果a为负数,运动方向不变,只是小海龟自身的方向与原来相反。
turtle.seth()、turtle.left()、turtle.right()的参数均为绝对角度。
turtle.dot()与turtle.circle()的参数均为半径。
turtle.color(“red”,”yellow”)表示画笔颜色为黄色,背景颜色为红色。
turtle.color(“red”)表示画笔颜色为红色,背景颜色随机。
turtle.color(color1,color2)指令中的参数color2是可选项,可以只有一个颜色参数。
turtle.color(color1,color2)指令中若将color1和color2删掉,即turtle.color(),小海龟在向前走100像素时,画布不会出现小海龟的轨迹。
print("床前明月光,疑是地上霜")
print("""床前明月光 疑是地上霜""")
print("床前明月光
疑是地上霜")
print("""床前明月光
疑是地上霜""")
import turtle
turtle.color("red")
turtle.dot(10)
turtle.done()
import turtle
turtle.color("red","red")
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
turtle.done()
import turtle
turtle.pencolor("red")
turtle.dot(10)
turtle.done()
import turtle
turtle.color("red")
turtle.dot(5)
turtle.done()
turtle.home()
turtle.clear()
turtle.goto()
turtle.setup()
A
B
C
D
iPython
Dev-C
Visual Studio Code
IDLE
print('原创精神:自主可控!自主可控!自主可控!')
print('原创精神:' '自主可控!'*3)
print('原创精神:自主可控!'*3)
print('原创精神:' '自主可控!’*2 '自主可控!')
1
2
3
4
turtle.screensize(500,500,0,0)
turtle.screensize(0,0,500,500)
turtle.setup(0,0,500,500)
turtle.setup(500,500,0,0)
54_name
name?
name
'name'
*
%
//
#
!=
and
*=
*
15
22
8
105
运行代码后,会画出一个正方形。
运行代码后,会画出一个正方形以及一条从(0, 0)到(100, 100)的连线。
运行代码后,turtle面朝方向是水平向右。
运行代码后,turtle面朝方向是竖直向上。
3
程序运行错误,没有输出。
3.3
True
Python采用代码缩进和冒号':'区分代码之间的层次。
在IDLE编写代码时,使用中文输入代码中的小括号或者双引号,任何位置都不会产生语法错误。
Python32位和64位的安装包没有区别,可以任意使用一个。
Pycharm和Microsoft Visual Studio都可以用来编写Python程序,但是语法和IDLE不一致。
1
2
4
6
24
144
36
12
8
2
14
16
True
False
20
15
//
**
*
发表评论 取消回复