"Alan Cameron" <alan.came...@iname.com> writes: > I am not sure of this is the right place to ask a question about the > tutorial > > http://docs.python.org/3.0/tutorial/datastructures.html#sets > > why is the printed result of > >>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'} >>>> print(basket) > {'orange', 'banana', 'pear', 'apple'} > > in the sequence given?
A set is an unordered container, but due to the nature of an object representation (which is a sequence of characters), its representation has to list the elements in a certain order. However, this order is not significant. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list