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