题目1单选题
What will be the output of the following Python code? a=[13,56,17] a.append([87]) a.extend([45,67]) print(a)A. [13, 56, 17, 87, 45, 67]B. [13, 56, 17, [87], [45, 67]]C. [13, 56, 17, 87,[ 45, 67]]D. [13, 56, 17, [87], 45, 67]
题目4单选题
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], which output of the following choices is correctA. >>> numbers[: -1] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]B. >>> numbers[-2:] [9, 10]C. >>> numbers[0::3] [1, 3, 5, 7, 9]D. >>> numbers[0: 2] [1, 2, 3]
题目6单选题
What will be the output of the following Python code? >>> s=["pune", "mumbai", "delhi"] >>> [(w.upper(), len(w)) for w in s]A. [('PUNE', 4), ('MUMBAI', 6), ('DELHI', 5)]B. ErrorC. ['PUNE', 4, 'MUMBAI', 6,'DELHI', 5]D. [PUNE, 4, MUMBAI, 6, DELHI, 5]
题目10单选题
What will be the output of the following Python code? s="a@b@c@d" a=list(s.partition("@")) print(a) b=list(s.split("@")) print(b)A. ['a', '@', 'b@c@d'] ['a', 'b', 'c', 'd']B. ['a', '@', 'b@c@d'] ['a', '@', 'b', '@', 'c', '@', 'd']C. ['a', 'b', 'c', 'd'] ['a', 'b', 'c', 'd']D. ['a', '@', 'b', '@', 'c', '@', 'd'] ['a', 'b', 'c', 'd']