I found out something weird and I was wondering if it was a known thing. This is my code: -Python 3.5.2-
numbers = [9,4,6,7,1]
setlist = set()
for item in numbers:
setlist.add(item)
print(setlist)
numbers = [9,4,6,7,1,5]
setlist = set()
for item in numbers:
setlist.add(item)
print(setlist)
And this is my output (it never changes):
{9, 4, 1, 6, 7}
{1, 4, 5, 6, 7, 9}
Process finished with exit code 0
If you run it you will see that the first output isn't in order but the second one is. It seems to only gets in order for some reason if the set has more then 5 objects. Wiki.python.com also says that sets dont get sorted at al. This all is really weird to me so i hoped i could get some more explanation.