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(
16-update
语法讲解 今天学: Python 集合 set 基础与综合 s={1} s.update([2,3]) print(s) 小练习 运行下面代码后输出是什么? s={1} s.update([2
15-issubset
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}.issubset({1,2,3})) 小练习 运行下面代码后输出是什么? print({1,2}.issubset
14-对称差 ^
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}^{2,3}) 小练习 运行下面代码后输出是什么? print({1,2}^{2,3}) 提交要求: 只提交最终输
13-差集 -
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2,3}-{2}) 小练习 运行下面代码后输出是什么? print({1,2,3}-{2}) 提交要求: 只提交最终输
12-交集 &
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}&{2,3}) 小练习 运行下面代码后输出是什么? print({1,2}&{2,3}) 提交要求
11-并集 |
语法讲解 今天学: Python 集合 set 基础与综合 print({1,2}|{2,3}) 小练习 运行下面代码后输出是什么? print({1,2}|{2,3}) 提交要求: 只提交最终输