Python:如何使用集合intersection_update方法

2024-10-11 20:28:59

1、首先在PyCharm软件中,打开一个Python项目。

Python:如何使用集合intersection_update方法

3、在python文件编辑区中,使用大括号定义一个“x”集合对象。

Python:如何使用集合intersection_update方法

5、继续输入:“x.intersection_update(y) ”,点击Enter键。

Python:如何使用集合intersection_update方法

7、在编辑区域点击鼠标右键,在弹出菜单中选择“运行”选项。

Python:如何使用集合intersection_update方法
猜你喜欢