Duplicate Elements in a Set in Python
Sets cannot store duplicate elements. If you assign several identical elements to a set, they will be removed during output:
st = {1, 1, 2, 2, 3, 4, 5}
print(st) # {1, 2, 3, 4, 5}
The following code is given:
st = {'ab', 'bc', 'cd', 'bc'}
print(st)
Tell me what will be output to the console.
The following code is given:
st = {'12', '34', '56', 34}
print(st)
Tell me what will be output to the console.