题目2单选题
What will be the output of the following Python code? lst=[3,4,6,1,2] lst[1:2]=[7,8] print(lst) lst[3]=[9,10] print(lst)A. [3, 7, 8, 6, 1, 2] [3, 7, 8, [9, 10], 1, 2]B. [3,[7,8],6,1,2] [3, 7, 8, 9, 10, 1, 2]C. [3,4,6,7,8] [9,10,4,6,7,8]D. Syntax error
题目3单选题
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]]
题目5单选题
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. ['PUNE', 4, 'MUMBAI', 6,'DELHI', 5]C. ErrorD. [('PUNE', 4), ('MUMBAI', 6), ('DELHI', 5)]
题目8单选题
What will be the output of the following Python code? a=[1,2,3] b=a.append(4) print(a) print(b)A. [1,2,3] [1,2,3,4]B. [1, 2, 3, 4] NoneC. Syntax errorD. [1,2,3,4] [1,2,3,4]