python-3.6 printing set expression not in order

Viewed 50

There is one question about Python3.6. It's about the output of Set expressions. I do not know why the code below does not appear in order:

a = {i*2 for i in range(1, 5)}
print(a)

I expect {2, 4, 6, 8} but the output is {8, 2, 4, 6}

Why it is not in order?

3 Answers
Related