Is there an algorithm in printing the contents of sets and dictionaries? What I mean is, let's say I have some set like this:
my_set = set({1,2.7,3,4.5,5})
If I print my_set
, how do I know what order I'll get it in? I know it's using the same order over & over again for this particular set, but what if I don't know what my set is going to be? Is the order just random? Or is there an algorithm? How does this work for dictionaries, is it the same concept?