Filter list

    0

    5

    Python public recipes

    Filter element of a list and creating a new list

    Shortcut: list.filter

    newlist = [x for x in initial_list if not predicate(x)]
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.