Python sort list dictionary

    0

    0

    Neuron123

    The code creates a new list containing the items from the original list being sorted in ascending order by their respective keys.

    newlist = sorted(list_to_be_sorted, key=lambda d: d['name'])
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.