Python 集合 copy() 方法

实例

复制 fruits 集合:

  1. fruits = {"apple", "banana", "cherry"}
  2. x = fruits.copy()
  3. print(x)

定义和用法

copy() 方法复制集合。


语法

  1. set.copy()
参数值

无参数。

分类导航