Python Set copy() Method
Description
The copy() method copies a set.
Syntax
Syntax of the copy() method:
set.copy()
Parameters
- none.
Return Value
Returns the copied set.
Example
Copy the fruits set:
Example 1
sites
= {
"
"
,
"
Runoob
"
,
"
Taobao
"
}
x
=
sites
.
copy
(
)
(
x
)
The output is:
set(['Google', 'Taobao', 'Runoob'])
Python Sets