I am a beginner in python. As a part of my learning over data types, I came across this particular behavior of SET
If I print a set as below
print ({2,1,3,4})
it giving sorted out put
{1, 2, 3, 4}
If I print as below
print ({7,6,8,9} | {1,2,3,4})
it giving again sorted out put only
{1, 2, 3, 4, 6, 7, 8, 9}
But if i print the below sets
print ({7,6,8,9})
print ({2,1,8,9})
the output I am receiving as below
{8, 9, 6, 7}
{8, 1, 2, 9}
which is not sorted
So please help me in understanding , on what basis this out put is coming.