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?
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?