Home >>Python Built-in Functions >Python set() Function
Python set() function is used to creates a set object. The items in a set list are unordered so it will appear in random order.
Syntax:set(iterable)
Parameter | Description |
---|---|
iterable | This is a required parameter. It defines a sequence, collection or an iterator object. |
x = set(("Abhi", "Ravi", "Dhruv"))
print(x)
x = set((1, 2, 3, 4, 5))
print(x)