New submission from Mirwi <mi...@binary-kitchen.de>:
>>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print(f) ... apple banana orange pear Shouldn't 'apple' appear two times as basket is a list that allows duplicates, not a set? I'm just doing my first steps into Python and may be mislead. In that case, sorry for the fuzz. ---------- assignee: docs@python components: Documentation messages: 362395 nosy: docs@python, mirwi priority: normal severity: normal status: open title: Tutorial, 5.6 Looping Techniques, sorted() example type: enhancement versions: Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39705> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com