0

How the sets order the items. Since it always returns them in the same way.

my_set = {45 ,22, 4, 34, 5}
print(my_set)
print(my_set)
print(my_set)

and the output is:

{34, 4, 5, 22, 45}
{34, 4, 5, 22, 45}
{34, 4, 5, 22, 45}

Thanks!

  • 2
    Note that dictionaries and sets are different things. Your question title and content appears to be about sets, not dictionaries. – shadowtalker Jul 27 '22 at 02:07
  • I *think* this is what you're asking? https://stackoverflow.com/questions/1653970/does-python-have-an-ordered-set – Iguananaut Jul 27 '22 at 02:07

0 Answers0