[Python] Find element by key in json

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

  1. Stack

    Stack Membro Participativo

    I want to fetch an element under the key ID in my json list that looks like this: [{"ID": 0, "login": "admin", "password": "123", "email": "apple@gmail.com"}, {"ID": 1, "login": "admin2", "password": "1234", "email": "grape@gmail.com"}] The list is in the data.json file and it’s not assigned any variable. I have a 'check' variable that takes the value of a number. I want to call the check function from ANOTHER python file.Here’s how: if "ID"==check return True.

    Continue reading...

Compartilhe esta Página