Message362395
>>> 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. |
|
Date |
User |
Action |
Args |
2020-02-21 09:24:31 | mirwi | set | recipients:
+ mirwi, docs@python |
2020-02-21 09:24:31 | mirwi | set | messageid: <1582277071.44.0.766763125418.issue39705@roundup.psfhosted.org> |
2020-02-21 09:24:31 | mirwi | link | issue39705 messages |
2020-02-21 09:24:31 | mirwi | create | |
|