题目内容

下列关于字典的定义,()是错误的。

A. 值可以是任意类型的python对象
B. 属于python中的不可变数据类型
C. 字典数据用花括号{}包裹
D. 由键值对(key-value)构成

查看答案
更多问题

对于字典dic={'a':1,'b':2,'c':3}则len(dic)的结果为()

A. 6
B. 2
C. 3
D. 4

当x = 0 and y = 5, 以下代码输出:x = float(input("Enter a number for x: "))y = float(input("Enter a number for y: "))if x == y:if y != 0:print("x / y is", x/y)elif x < y:print("x is smaller")else:print("y is smaller")

A. x is smaller
B. y is smaller
C. x / y is 0.0
D. 出错

如果你输入的是“Right”,以下代码输出结果为:n = input("You're in the Lost Forest. Go left or right? ")while n == "right":n = input("You're in the Lost Forest. Go left or right? ")print("You got out of the Lost Forest!")

A. You're in the Lost Forest. Go left or right?
B. You got out of the Lost Forest
C. You're in the Lost Forest. Go left or right?之后,会再次等待输入
D. 死循环

以下代码输出 结果为:mysum = 0for i in range(5, 11, 2):mysum += iif mysum == 5:breakmysum += 1print(mysum)

A. 5
B. 6
C. 21
D. 24

答案查题题库