Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
combining lists
#4
One other thing. You can't sort a set. By definition a set is an unordered collection.

From the docs: https://docs.python.org/3/tutorial/datas....html#sets
Quote:Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference.
If you put sorted values in a set they will not retain their order.
Reply


Messages In This Thread
combining lists - by stealth - Feb-06-2022, 07:55 PM
RE: combining lists - by deanhystad - Feb-06-2022, 08:05 PM
RE: combining lists - by stealth - Feb-06-2022, 08:06 PM
RE: combining lists - by deanhystad - Feb-08-2022, 04:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Split dict of lists into smaller dicts of lists. pcs3rd 3 2,457 Sep-19-2020, 09:12 AM
Last Post: ibreeden
  combining lists in a dictionary Skaperen 9 3,542 Nov-04-2019, 05:28 PM
Last Post: DeaD_EyE
  sort lists of lists with multiple criteria: similar values need to be treated equal stillsen 2 3,328 Mar-20-2019, 08:01 PM
Last Post: stillsen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020