#Py1002. python一级模拟卷一-3

python一级模拟卷一-3

单选题

1、Python数据类型,下列说法不正确的是?() {{ select(1) }}

  • int可以转换为float型
  • float型不能转换为int型
  • int代表的是整型
  • type()函数可以查看变量的数据类型

2、下面哪个字符不能用做变量名?() {{ select(2) }}

  • the
  • is
  • yes
  • no

3、下方代码绘制出的图形是哪个?()

import turtle
turtle.color('green')
turtle.circle(80)
turtle.color('red')
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()

{{ select(3) }}

4、print(1<2 and 3<2 or 3<4 and 'a' != 'a' or not 2+3>=6)的结果是?() {{ select(4) }}

  • False
  • True
  • 2
  • 1

5、Turtle库中,直接跳转到(x, y)点的命令是?() {{ select(5) }}

  • turtle.go(x,y)
  • turtle.setup(y,x)
  • turtle.goto(x,y)
  • turtle.forward(x,y)

6、Turtle库中,用于设置画笔的颜色的命令是?() {{ select(6) }}

  • turtle.speed()
  • turtle.pencolor()
  • turtle.penup()
  • turtle.pensize()

7、以下哪个是Python保存文件时的文件扩展名?() {{ select(7) }}

  • .yp
  • .py
  • .ppy
  • .yyp

判断题

8、变量名大小写是没有区分的,如变量名stuname和StuName是没区别的。() {{ select(8) }}

  • 正确
  • 错误

9、Python可以同一行显示多条语句,方法是在语句中间用分号“;”分开。 {{ select(9) }}

  • 正确
  • 错误

10、运行下列Python代码可以画出一个绿色的圆。()

import turtle
turtle.penup()
turtle.color('green')
turtle.circle(50)
turtle.pendown()

{{ select(10) }}

  • 正确
  • 错误

11、在Python中输入80/4//3,计算结果为6.0。() {{ select(11) }}

  • 正确
  • 错误

12、turtle库中,我们用turtle.setup()函数来设置画布大小,参数width,height为0~1的小数时,意为宽和高占据电脑屏幕的比例。 {{ select(12) }}

  • 正确
  • 错误