[Python] Convert JSON array to Python list

Discussão em 'Python' iniciado por Stack, Abril 20, 2025.

  1. Stack

    Stack Membro Participativo

    import json

    array = '{"fruits": ["apple", "banana", "orange"]}'
    data = json.loads(array)


    That is my JSON array, but I would want to convert all the values in the 'fruits' string to a Python list. What would be the correct way of doing this?

    Continue reading...

Compartilhe esta Página