2406
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
选择题
- 在使用 turtle 绘制图形时,如果要控制小海龟移动到 x 坐标为 200,y 坐标为 150 的位置,以下代码能够实现效果的是? {{ select(1) }}
turtle.go(150, 200)turtle.go(200, 150)turtle.goto(150, 200)turtle.goto(200, 150)
- 下列关于 Python 程序设计语言的说法,错误的是? {{ select(2) }}
- Python 是一门面向对象的编程语言
- Python 程序文件后缀是
.py - Python 程序只能在 IDLE 上运行
- Python 程序支持多种操作系统
- 在 Python 中,使用
type()函数可以获取参数的数据类型,那么运行type("int")的运行结果是? {{ select(3) }}
<class 'int'><class 'str'><class 'float'><class 'bool'>
- 使用下列哪一项可以导入 turtle 画图模块? {{ select(4) }}
import turtleimport Turtleturtle importimport turtle.Turtle
- 使用
turtle.circle(4,360,6)绘制的是什么图形? {{ select(5) }}
- 半径为 4 的圆
- 半径为 360 的圆
- 六边形
- 正方形
- 下列表达式的结果最大的是? {{ select(6) }}
20 % 420 ** 220 * 420 // 4
-
程序1:
a = (5 > 4) + 2 print(a)程序2:
b = 5 > 4 + 2 print(b)的运行结果分别是? {{ select(7) }}
3 FalseTrue 2True 33 True
- 下列关于
turtle.circle()和turtle.dot()指令说法正确的是? {{ select(8) }}
turtle.circle()指令只能绘制圆或者圆弧turtle.circle()的参数为直径,turtle.circle(30)绘制的图形半径为 15turtle.dot()指令的作用是绘制圆点turtle.dot()的参数为半径,turtle.dot(30)绘制的图形半径为 30
-
关于 turtle 库说法正确的是?
① 画布的位置是固定的,无法调整
②write()指令可以在画布中添加文字
③goto(100,100)指的是将画笔移动到坐标为 (100,100) 的位置上
④dot(100)可以绘制出一个半径为 100 的圆{{ select(9) }}
- ①②
- ①③
- ②③
- ③④
- 在 Turtle 库中,既可以设置画笔颜色,又可以设置填充颜色的指令是? {{ select(10) }}
turtle.color()turtle.bgcolor()turtle.pencolor()turtle.fill_color()
- 假设
a="吉祥"; b="如意"; c="a"+"b"; print(c),请问输出结果是? {{ select(11) }}
吉祥 如意吉祥如意aba+b
-
如果你今年的年龄是 10 周岁,则运行下面的程序,在提示语后面输入 10 后,
c的值为多少?a = input('请输入你的年龄:') c = a + 2{{ select(12) }}
12102- 程序出错
'10+2'
- Python 中如何计算得到 2024 除以 3 的余数? {{ select(13) }}
2024 % 32024 // 32024 / 32024 \ 3
- 下列各语句输出结果为
True的是? {{ select(14) }}
print((0>1) or (2>1))print(not 1)print((1>=0) and (1>=2))print(True != 1)
- 在 Python 中,表达式
6 - 3 * 2的结果是? {{ select(15) }}
06121
- 在 Python 中,以下哪个表达式的结果与其他三个不同? {{ select(16) }}
True and Falsenot False3 < 44 != 5
- 运行下面 IDLE 中的代码,应使用哪个选项中的功能? {{ select(17) }}
File中的OpenEdit中的UndoRun中的Run ModuleOptions中的Configure IDLE
-
执行下面的代码,打印结果为?
# print('锲而舍之,朽木不折;') print('锲而不舍,金石可镂。'){{ select(18) }}
-
锲而舍之,朽木不折; 锲而不舍,金石可镂。 -
锲而不舍,金石可镂。 锲而舍之,朽木不折; 锲而舍之,朽木不折;锲而不舍,金石可镂。
- 执行代码
print(17 or 39),打印结果为? {{ select(19) }}
TrueFalse1739
- 阿明在一条小河边取水,他有两个水桶,一个红色一个绿色。红色水桶的容量是 6 升,绿色水桶的容量是 7 升。阿明想在红色水桶中正好装入 5 升水,他该怎么做呢?下面给出了八项操作,选择其中的一部分就能在红色水桶中正好装入 5 升水。哪个选项中的操作顺序能够达到目标?
① 将红色水桶装满; ② 将绿色水桶装满; ③ 第二次将红色水桶装满; ④ 第二次将绿色水桶装满; ⑤ 将红色水桶中的水全部倒入绿色水桶; ⑥ 将绿色水桶中的水全部倒入红色水桶; ⑦ 将红色水桶中的水倒入绿色水桶,直到绿色水桶装满; ⑧ 将绿色水桶中的水倒入红色水桶,直到红色水桶装满;
{{ select(20) }}
- ②①⑦③
- ①⑤⑧④
- ②⑧④⑤
- ①⑤③⑦
- 下面哪个选项的代码,可以画出一个直径为 80 的红色空心圆形? {{ select(21) }}
-
import turtle turtle.color('red') turtle.circle(40) -
import turtle turtle.color('red') turtle.dot(80) -
import turtle turtle.color('red') turtle.begin_fill() turtle.circle(40) turtle.end_fill() -
import turtle turtle.pencolor('red') turtle.begin_fill() turtle.dot(80) turtle.end_fill()
print("16+2")输出的结果是? {{ select(22) }}
"16+2"1816216+2
- 下面哪个选项可以作为 Python 的变量名? {{ select(23) }}
forifelseBreak
- 以下运算符中,运算优先级最高的是? {{ select(24) }}
<=or==%
- 已知变量
a=8,b=7,执行语句a *= a - b后,变量a的值为以下哪一个? {{ select(25) }}
-88-77
判断题
- Python 无论在哪个编译器中编写代码,编写完一行代码后,回车就会马上运行出现输出结果。 {{ select(26) }}
- 对
- 错
toy = '足球'这句代码中,toy是变量的名字。 {{ select(27) }}
- 对
- 错
- 运行
str(49)的结果是'49'。 {{ select(28) }}
- 对
- 错
-
以下 Python 语句的运行结果是 “hello world”。
print("hello", end=' ') print("world"){{ select(29) }}
- 对
- 错
- 在 Python 编程中,
input()为输入函数,在输入数据时,可以将输入数据直接显示到控制台。 {{ select(30) }}
- 对
- 错
- 在 Python 中允许同时为多个变量进行赋值,故赋值语句:
a,b,c = 1,2,3,4是正确的。 {{ select(31) }}
- 对
- 错
- Python3 的代码可以直接在 Python2 上运行。 {{ select(32) }}
- 对
- 错
- 在 Python 中,
and、or、True和False都是保留字。 {{ select(33) }}
- 对
- 错
hideturtle()可以将画笔移动到起始位置。 {{ select(34) }}
- 对
- 错
turtle库中,turtle.begin_fill()和turtle.end_fill()必须成对使用。 {{ select(35) }}
- 对
- 错