题目内容

以下代码输出结果为: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

下列代码有多少行输出。def add(x, y):return x+ydef mult(x, y):print(x*y)add(1,2)print(add(2,3))mult(3,4)print(mult(4,5))

A. 0
B. 2
C. 4
D. 5

以下代码输出结果为:def sq(func, x):y = x**2return func(y)def f(x):return x**2calc = sq(f, 2)print(calc)

A. 4
B. 8
C. 16
D. 出错,没有输出

已知以下函数定义,请问执行函数调用always_sunny(('cloudy'), ('cold',))的结果为:def always_sunny(t1, t2):""" t1, t2 are non empty """sun = ("sunny","sun")first = t1[0] + t2[0]return (sun[0], first)

A. ('sunny', 'ccold')
B. ('sunny', 'cc')
C. ('sunny', 'cloudycold')
D. ( 'cloudy','cold')

答案查题题库