Create dictionary from lists

    0

    11

    Python public recipes

    Create a dictionary from two lists

    keys = ['a', 'b', 'c']
    values = [1, 2, 3]
    dictionary = dict(zip(keys, values))
    # {'a': 1, 'b': 2, 'c': 3}
    
    # keys = ['a', 'b', 'c']
    # values = [1, 2, 3]
    dictionary = dict(zip(keys, values))
    
    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.