Shashwat Anand <anand.shash...@gmail.com> added the comment: I guess giving fruit, the set of unique fruit a different name makes it more clear. Comments alignment fixed.
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'} >>> print(basket) {'orange', 'bananna', 'pear', 'apple'} >>> fruit = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> uniquefruit = set(fruit) # create a set without duplicates >>> uniquefruit {'orange', 'pear', 'apple', 'banana'} ---------- nosy: +l0nwlf Added file: http://bugs.python.org/file16793/datastructure.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4570> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com