python set print in a sequential order

Viewed 19
s = set()
while len(s)< 50:
    x = random.randint(1,50)
    s.add(x)

print(s)

The code is adding first 50 numbers in a random order in a set but when the set is printed, numbers are printed in sequential order, why?

0 Answers
Related