#Use the set() function

print(set()) #returns an empty set

L = ["Python", "C++", "Ruby", "PHP"]
print(set(L)) #creates a set from an iterable object.

The set() function is used to turn a given iterable argument such a list, a tuple, a string , etc. into a set. It is also used without an argument to create an empty set

set(iterable = None)
iterable An optional parameter representing the iterable object to be casted to a set data type.

When the function is called without an argument it returns an empty set. When it is called with an iterable argument, the set() function produces a new set object from the argument. The elements within the resulting set object may not retain the same order as they were present in the original iterable. Additionally, each element in the iterable appears only once in the resulting set, ensuring the preservation of the set's uniqueness of elements property.

set([1, 2, 3])
//{1, 2, 3}
set(( 3, 3, 2, 2, 1, 1,))
//{1, 2, 3}
//{0, 1, 2, 3, 4}
set({1:'one', 2:'two', 3:'three'})
//{1, 2, 3}
set("Hello, World!")
//{' ', ',', '!', 'o', 'W', 'e', 'H', 'r', 'l', 'd'}

You should note that sets cannot contain mutable elements, such as a list. A TypeError is raised if we try to use the set() function with an iterable that contains a mutable object. Examples:

set([[1, 2, 3], [4, 5, 6]])
//TypeError: unhashable type: 'list'