[Python] Python code to remove the nested key from a value in dictionary

Discussão em 'Python' iniciado por Stack, Fevereiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    Currently I have a nested dictionary with keys as "Apple" and "Mango". and in the value we have "0" again as keys.

    Fruits = {
    "Apple": {
    "0": 0.066
    },
    "Mango": {
    "0": 0.933
    }
    }


    instead I wish it to look like :

    Fruits = {
    "Apple": 0.066
    ,
    "Mango": 0.933
    }

    Continue reading...

Compartilhe esta Página