set declaration python code example
Example 1: empty set python
# Distinguish set and dictionary while creating empty set
# initialize a with {}
a = {}
# check data type of a
print(type(a))
# initialize a with set()
a = set()
# check data type of a
print(type(a))
Example 2: python set
set_example = {1, 2, 3, 4, 5, 5, 5}
print(set_example)
# OUTPUT
# {1, 2, 3, 4, 5} ----- Does not print repetitions