Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
combining lists
#2
Because sorted takes an iterable argument and returns a list. It doesn't care about the type of the argument as long it is iterable.

From the documents: https://docs.python.org/3/library/functions.html#sorted

Quote:sorted(iterable, /, *, key=None, reverse=False)
Return a new sorted list from the items in iterable.
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,540 Sep-19-2020, 09:12 AM
Last Post: ibreeden
  combining lists in a dictionary Skaperen 9 3,613 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,416 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