PythonBuilt-inset
tuple

setBuilt-in

dict

Converts an iterable to a set.

Syntax

set(iterable?)

Example

Enter values below to update the example in real time.

print
print(set([1, 2, 2, 3, 3]))  # {1, 2, 3}
a = {1, 2, 3}
b = {2, 3, 4}
print(a & b)  # {2, 3}
print(a | b)  # {1, 2, 3, 4}