Easy Tutorial
❮ Python Check String Python Func Number Shuffle ❯

Python Set copy() Method

Python Set


Description

The copy() method is used to copy a set.

Syntax

The syntax for the copy() method:

set.copy()

Parameters

Return Value

Returns the copied set.

Example

Copying the fruits set:

Example 1

sites = {"Google", "tutorialpro", "Taobao"}
x = sites.copy()
print(x)

Output:

set(['Google', 'Taobao', 'tutorialpro'])

Python Set

❮ Python Check String Python Func Number Shuffle ❯