[Python] Python: get a dict from a list based on something inside the dict

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I need to find a dict in this list based on a unique value (id) inside that dict:

    [
    {
    'title': 'some value',
    'value': 123.4,
    'id': 'an id'
    },
    {
    'title': 'another title',
    'value': 567.8,
    'id': 'another id'
    }
    ]


    Caveats: title and value can be any value (and the same), id would be unique.

    I know this can be done through the use of loops, but this seems cumbersome

    Continue reading...

Compartilhe esta Página