26-差集为空
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}-{1,2}) 小练习 运行下面代码后输出是什么? print({1,2}-{1,2}) 提交要求: 只提交最终输
25-空交集
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}&{3,4}) 小练习 运行下面代码后输出是什么? print({1,2}&{3,4}) 提交要求
24-集合大小比较
语法讲解 今天学: Python 集合 set 基础与综合 print(len({1,2}|{2,3})) 小练习 运行下面代码后输出是什么? print(len({1,2}|{2,3})) 提交
23-难度5 推导+条件
语法讲解 今天学: Python 集合 set 基础与综合 print({x for x in range(6) if x%2==0}) 小练习 运行下面代码后输出是什么? print({x for
22-难度5 多步操作
语法讲解 今天学: Python 集合 set 基础与综合 s={1,2,3} s.add(4) s.remove(2) s.update([5]) print(s) 小练习 运行下面代码后输
21-难度5 嵌套运算
语法讲解 今天学: Python 集合 set 基础与综合 a={1,2,3} b={2,3,4} print((a|b)-(a&b)) 小练习 运行下面代码后输出是什么? a={1,
20-遍历集合
语法讲解 今天学: Python 集合 set 基础与综合 for x in {1,2}: print(x) 小练习 运行下面代码后输出是什么? for x in {1,2}: print(x)
19-集合推导式
语法讲解 今天学: Python 集合 set 基础与综合 print({x*x for x in range(3)}) 小练习 运行下面代码后输出是什么? print({x*x for x in
18-copy
语法讲解 今天学: Python 集合 set 基础与综合 s={1,2} t=s.copy() t.add(3) print(s) 小练习 运行下面代码后输出是什么? s={1,2} t=s
17-clear
语法讲解 今天学: Python 集合 set 基础与综合 s={1,2} s.clear() print(len(s)) 小练习 运行下面代码后输出是什么? s={1,2} s.clear(