[Python] Make a dictionary (dict) from separate lists of keys and values

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    I want to combine these:

    keys = ['name', 'age', 'food']
    values = ['Monty', 42, 'spam']


    into a single dictionary:

    {'name': 'Monty', 'age': 42, 'food': 'spam'}


    How can I do this?

    Continue reading...

Compartilhe esta Página