中国大学MOOC: x=[[]]*3x[0].append(1)print(x)上述代码的输出结果是____。
[[1], [1], [1]]
举一反三
- x=[[]] x[0].append(1) print(x) 上述代码的输出结果是____
- x=([1],[2]) x[0].append(1) print(x) 上述代码的输出结果是____
- 已知x = [[]] * 3,那么执行语句x[0].append(1)之后,x的值为______ 。
- 已知x = [[] for i in range(3)],那么执行语句x[0].append(1)之后,x的值为_________________。
- 已知x = [ [ ] ] * 3,那么执行语句x[0].append(1)之后,x的值为_________。 A: [ [0], [1] ] B: [ [1], [1], [1] ] C: [1,1] D: [1,1,1]
内容
- 0
中国大学MOOC: 假设x的值为 [[1,3,5], [2,4,6]], tf.transpose(x)的结果是()
- 1
已知x = [[1], [2]],那么执行语句x[0].append(3)后x的值为______
- 2
中国大学MOOC: 已知程序如下:lst=[[1,2],[3,4],[5,6]]for x in lst: print(x[0]*x[1],end=,)执行该程序后,输出结果为:__________ 。
- 3
下面代码的输出结果是( )。>>> x = 26.59>>> print(type(x))>>> y = "100083">>> print(type(y))知识点:数据的类型 未知类型:{'options': ["[class 'float'][class 'str']", "[class 'int'][class 'str']", "[class 'float'][class 'int']", "[class 'int'][class 'int']"], 'type': 102}
- 4
下列Python语句的输出结果是。 x=y=[1,2] x.append(3) print(x is y,x==y,end=') z=[1,2,3] print(x is z,x==z,y==z)