set1 = {1,2,3} set2 = {2,3,4} set1和set2的并集是?
A: {1,2,3}
B: {2,3,4}
C: {1,2,3,4}
D: {2,3}
A: {1,2,3}
B: {2,3,4}
C: {1,2,3,4}
D: {2,3}
举一反三
- 设a = set([1, 2, 2, 3 , 3, 3, 4, 4, 4, 4]),则 sum(a) 的值是________。
- 下面代码的运行结果为 set1 = {1, 3, 9} set2 = {2, 4, 8, 9} set1.difference(set2)
- set1 = {1,2,3} set2 = {2,3,4} set1和set2的并集是? A: {1,2,3} B: {2,3,4} C: {1,2,3,4} D: {2,3}
- 下列语句,哪个不能创建一个集合? A: set( ) B: (1, 2, 3) C: set((1, 2, 3)) D: {1, 2, 3}
- 下面程序的功能是输出以下9阶方阵。请填空。 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 2 3 3 3 3 3 2 1 1 2 3 4 4 4 3 2 1 1 2 3 4 5 4 3 2 1 1 2 3 4 4 4 3 2 1 1 2 3 3 3 3 3 2 1 1 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 # include