wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

python考级培训课后测验-day3

Total questions: 15

Worksheet time: 15mins

Name
Class
Date
1.

Python 自带的编程环境是?( )

a)

PyScripter

b)

Spyder

c)

Notepad++

d)

IDLE

2.

关于以下代码的说法正确的是?( ) t = int(turtle.textinput('边数','几边形:')) turtle.circle(50, steps=t) turtle.done()

a)

circle 是画圆的代码,因此该程序运行后的图案一定是圆

b)

运行该程序后,需要用户自己输入边数,确定画 “几边形”

c)

变量 t 没有给出具体的数值,因此该程序运行有错误

d)

该程序运行后,会画出 50 个圆

3.

幂运算运算符为?( )

a)

*

b)

*+

c)

**

d)

/

4.

这段代码的运行结果是?( )


import turtle

g = turtle.Pen()

g.fillcolor("red")

g.begin_fill()

g.circle(50)

g.pencolor("yellow")

g.fillcolor("green")

g.circle(50, steps=5)

g.end_fill()

a)
b)
c)
d)
5.

假设 a=20,b=3,那么 a or b 的结果是?( )

a)

20

b)

0

c)

1

d)

3

6.

假设 a=2,b=3,那么 a-b*b 的值是?( )

a)

-3

b)

-2

c)

-7

d)

-11

7.

以下选项中不符合 Python 变量命名规则的是?( )

a)

name

b)

2_to

c)

_Go

d)

Tea

8.

IDLE 环境的退出命令是?( )

a)

esc()

b)

close()

c)

回车键

d)

exit()

9.

print 的作用是什么?( )

a)

在屏幕上打印出来相应的文本或者数字等

b)

在打印机里打印相关文本或者数字等

c)

可以用来画图

d)

输出一个命令行

10.

使用 Python 画笔绘制如下图所示的图案,第 4 行的代码应如何补充?( )

a)

p.right(90)

b)

p.left(90)

c)

p.right(-90)

d)

p.left(-180)

11.

在 Python 中变量需要提前定义,可以不用赋值。

a)

正确

b)

错误

12.

使用 Turtle 时,画布默认坐标左上角为画布中心。

a)

正确

b)

错误

13.

print('hello,world')和 print('hello','world')输出内容一致。

a)

正确

b)

错误

14.

print(int(8>7) or int(8<6))的输出结果为 1。

a)

正确

b)

错误

15.

import 可以作为变量名。

a)

正确

b)

错误