im curious about how the logical operators work in sets. cosider this:
x = set('abcde')
y = set('bdxyz')
# union
print(x | y) # output: {'d', 'b', 'y', 'e', 'z', 'x', 'c', 'a'}
print(x or y) # output: {'d', 'b', 'e', 'c', 'a'}
# intersection
print(x and y) # output: {'d', 'b', 'y', 'z', 'x'}
print(x & y) # output: {'b', 'd'}
i expected the outputs for union and intersection to be the same for each. how is it possible that they are not? can anyone explain?