[Python] Update values of a list of dictionaries in python

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

  1. Stack

    Stack Membro Participativo

    I have a CSV file:

    Martin;Sailor;-0.24
    Joseph_4;Sailor;-0.12
    Alex;Teacher;-0.23
    Maria;Teacher;-0.57


    My objective is to create a list with dictionaries for each job:

    list_of_jobs = [{'Job' : Sailor, 'People' : ['Martin', 'Joseph']}
    {'Job' : Teacher, 'People' : ['Alex', 'Maria']}
    ]



    I created the dictionaries but I can't figure out how to update the value of list_of_jobs['People']

    Continue reading...

Compartilhe esta Página