下列关于字典的定义,()是错误的。
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. 死循环