青少年软件编程(Python)等级考试试卷(一级)
分数:100.00 题数:37
一、单选题
(共25题,每题2分,共50分)
1.
下列程序运行的结果是?( )
s = 'hello'
print(s+'world')
A、
sworld
B、
helloworld
C、
hello
D、
world
答案:
B
试题解析:
s和'world'都属于字符串类型,加法运算表示的是字符串拼接的操作,所以最后得到的答案为helloworld,所以选择B选项。
2.
下列选项中不符合Python语言变量命名规则的是?( )
A、
Computer
B、
P
C、
3_1
D、
_WO1
答案:
C
试题解析:
3.
在Python中,运行9//2,输出的结果是?( )
A、
3
B、
4.5
C、
4
D、
4.0
答案:
C
试题解析:
C
4.
下面哪一行代码的输出结果不是World2021?( )
A、
print("World"+"2021")
B、
print("World"+"20"+"21")
C、
print("World"+2021)
D、
print("World2021")
答案:
C
试题解析:
5.
在
Python
中,输入
3*4**2
,运算结果是?( )
A、
144
B、
24
C、
48
D、
6
答案:
C
试题解析:
6.
关于比较运算符说法正确的是?( )
①!=表示为不等于,如果两个操作数不相等,则为False
②<=表示为小于等于,如果左边的数小于或等于右边的数,则为True
③若a=2,b=5则a!=b为True
A、
①②
B、
②③
C、
①③
D、
①②③
答案:
B
试题解析:
7.
Python中的乘法是用哪个符号表示的?( )
A、
*
B、
X
C、
x
D、
#
答案:
A
试题解析:
8.
以下哪个选项可以作为Python文件的后缀名?( )
A、
.py
B、
.png
C、
.doc
D、
.pdf
答案:
A
试题解析:
9.
要给三个整型变量a、b、c赋值为5,下面Python程序正确的是?( )
A、
abc=5
B、
a=5,b=5,c=5
C、
a=b=c=5
D、
a=5 b=5 c=5
答案:
C
试题解析:
此题考查对变量赋值的理解,根据Python中对变量的赋值语法故答案选择C选项
10.
以下哪段程序能在画出三角形并隐藏turtle?( )
A、
import turtle
turtle.circle(150,steps=3)
turtle.hideturtle()
turtle.done()
B、
import turtle
turtle.circle(150,3)
turtle.hideturtle()
turtle.done()
C、
import turtle
turtle.circle(3)
turtle.hideturtle()
turtle.done()
D、
import turtle
turtle.circle(150,3,3)
turtle.hideturtle()
答案:
A
试题解析:
A
11.
turtle.home() 的作用是下列哪一种?( )
A、
移至初
202106Python编程真题——(1级)