Type: Objective

QKCP701~710

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

1、如果要输出字符串"Python",以下哪些代码是正确的( )`。 {{ multiselect(1) }}

  • print("Python")
  • print('Python')
  • echo("Python")
  • Print("Python")

2、Python中用于判断两个变量是否相等的运算符是什么?( )。 {{ select(2) }}

  • ==
  • !=
  • >=
  • <=

3、执行以下代码后,变量b的值是多少?( )。

a = 5
b = a == 5

{{ select(3) }}

  • True
  • False
  • 5
  • 'a == 5'

4、在Python中,关于布尔值的描述,正确的是?( )

{{ multiselect(4) }}

  • 布尔值只有True和False
  • 布尔值可以是任何非零数字
  • 布尔值可以是任何字符串
  • print(1==1)输出的是布尔值True

5、下列关于函数的说法正确的是( )。 {{ multiselect(5) }}

  • 函数必须由返回值
  • 函数可以没有参数
  • 函数定义时,参数必须具体指定值
  • 函数调用时可以传入参数

6、有一个列表nums = [1, 2, 3, 4, 5],以下哪些操作能够正确的从列表中删除一个元素?( )。 {{ multiselect(6) }}

  • nums.remove(3)
  • del nums[2]
  • nums.pop(2)
  • nums.delete(2)

7、在Python中哪些数据类型是不可变的?( )。

{{ multiselect(7) }}

  • 字符串
  • 列表
  • 整型
  • 字典

8、关于while循环的描述,正确的是( )。 {{ multiselect(8) }}

  • while循环必须由终止条件
  • while True创建的是一个无限循环
  • while循环不能用于遍历列表
  • while循环不能使用break语句

9、下列代码的输出是什么?( )。

def add(x, y):
    return x+y
print(add(3,7))

{{ select(9) }}

  • 3
  • 7
  • 10
  • 'add(3,7)'

10、下列哪些选项是python中的算数运算符?( )

{{ multiselect(10) }}

  • +
  • and
  • not
  • %

5.11模拟测试

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2025-5-11 19:15
End at
2025-5-11 20:15
Duration
1 hour(s)
Host
Partic.
8