下面哪个代码可以绘制一个直径为 200 的填充为红色, 轮廓为蓝边的圆形? ( )
import turtle
turtle.pencolor('blue')
turtle.fillcolor('red')
turtle.begin_fill()
turtle.circle(200)
turtle.end_fill()
import turtle
turtle.pencolor('blue')
turtle.fillcolor('red')
turtle.begin_fill()
turtle.circle(100, 360)
turtle.end_fill()
import turtle
turtle.color('blue')
turtle.dot(200)
import turtle
turtle.pencolor('blue')
turtle.fillcolor('red')
turtle.dot(100)
运行如下代码段, 输出结果正确的是? ( )
word1="o"
word2="n"
print(word2+word1)
on
no
word3
word2word1
下面哪一个不是 Python 的保留字? ( )
class
if
turtle
or
如果某年的第 1 天也就是一月一日是星期一。 星期一记作 1, 星期二记作 2, 以此类推,星期日记作 0。 要求这一年的第 d 天是星期几, 下列哪一种方法可以实现? ( )
d % 7
(d - 1) % 7
(d - 1) % 7 + 1
(d + 1) % 7
下列运算符中, 哪一个不是比较运算符? ( )
<
>
=!
=
在初始状态下, 执行以下命令后, turtle 的坐标为? ( )
turtle.forward(10)
turtle.left(90)
turtle.forward(20)
(10, 0)
(10, 20)
(10, 30)
(10, -20)
在 Python 编程环境下, IDLE 代表什么? ( )
编辑器
编译器
计算器
集成开发环境
print(5%10+5)的输出结果是? ( )
10
1/3
5.2
5
下列哪一个函数可以将海龟顺时针旋转? ( )
left()
right()
back()
forward()
Python 环境中, 以下代码注释正确的是? ( )
#这个是一个程序
/这个是一个程序/
"这是一个程序'
? 这是一个程序?
print(88-8)的运行结果是? ( )
88
80
88-8
81
分析下列程序, 说法错误的是? ( )
import turtle
turtle.color('blue')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.forward(100)
turtle.color('red', 'aqua')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.color('blue')表示的含义为: 设置轮廓和填充颜色均为"blue"
turtle.fllcolor('yellow')表示的含义为: 设置填充颜色为"yellow"
程序运行结果为: 绘制两个圆, 左边圆填充颜色为"yellow", 右边圆的颜色为"aqua"
最终绘制两个圆的轮廓颜色均为"blue
在 Python 中, 输入 18/6//3, 输出结果为? ( )
1
1.0
9
9.0
关于 Turtle 绘图, 下列说法错误的是? ( )
色彩处理时, 可以使用彩色画笔 pencolor( ), 也可以直接由 color( )方法更改目前画笔 的颜色
penup()指的是将笔提起, 不会绘制任何图形
在选择画笔粗细时可以使用 pensize()
在海龟绘图中, 画布中央是(0, 0), 往右 X 坐标值递减, 往左 X 坐标值递增
turtle.home() 的作用是下列哪一种? ( )
移至初始坐标 (0,0)
移至初始坐标 (0,0), 并设置朝向为初始方向
移至屏幕左上角
设置朝向为初始方向
要给三个整型变量 a、 b、 c 赋值为 5, 下面 Python 程序正确的是? ( )
abc=5
a=5,b=5,c=5
a=b=c=5
a=5 b=5 c=5
以下哪段程序能在画出三角形并隐藏 turtle? ( )
import turtle
turtle.circle(150,steps=3)
turtle.hideturtle()
turtle.done()
import turtle
turtle.circle(150,3)
turtle.hideturtle()
turtle.done()
import turtle
turtle.circle(3)
turtle.hideturtle()
turtle.done()
import turtle
turtle.circle(150,3,3)
turtle.hideturtle()
以下哪个选项可以作为 Python 文件的后缀名? ( )
.py
.png
.doc
Python 中的乘法是用哪个符号表示的? ( )
*
X
x
#
在 Python 中, 输入 3*4**2, 运算结果是? ( )
144
24
48
6
在 Python 中, 运行 9//2, 输出的结果是? ( )
3
4.5
4
4.0
下面哪一行代码的输出结果不是 World2021? ( )
print("World"+"2021")
print("World"+"20"+"21")
print("World"+2021)
print("World2021")
关于比较运算符说法正确的是? ( )
①!=表示为不等于, 如果两个操作数不相等, 则为 False
②<=表示为小于等于, 如果左边的数小于或等于右边的数, 则为 True
③若 a=2,b=5 则 a!=b 为 True
①②
②③
①③
①②③
下列选项中不符合 Python 语言变量命名规则的是? ( )
Computer
P
3_1
_WO1
下列程序运行的结果是? ( )
s = 'hello'
print(s+'world')
sworld
helloworld
hello
world