Flatten a list

    0

    0

    Python public recipes

    Flatten a nested list

    Shortcut: list.flatten

    def flatten(original_list):
      return [item for sublist in original_list for item in sublist]
    
    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.