当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
以下代码输出结果为:s = "6.00 is 6.0001 and 6.0002"new_str = ""new_str += s[-1]new_str += s[0]new_str += s[4::30]new_str += s[13:10:-1]print(new_str)
A. 260000
B. 26100
C. 26 100
D. 6.00 is 6.0001 and 6.0002
下列代码运行后,会输出"common letter"多少次?s1 = "mit u rock"s2 = "i rule mit"if len(s1) == len(s2):for char1 in s1:for char2 in s2:if char1 == char2:print("common letter")break
A. 0
B. 7
C. 8
D. 10