How do I sort a list of datetime or date objects ?

How do I sort a list of datetime or date objects ?

Asked on December 28, 2018 in Python.
Add Comment


  • 1 Answer(s)

    The function named list.sort() is yields nothing. It operates only in-place, but it modifies or make changes the list itself. All we need to call a.sort() without assign it a again.

    We have another built in function called sorted(), that yields a list’s sorted version  – a = sorted(a) will do everything that we need.

    Answered on December 28, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.