How to dynamically store values from .json file and compare them with user input in python?

I have .json file like this:

[
{
    "name": {
        "common": "Aruba",
        "official": "Aruba",
        "native": {
            "nld": {
                "official": "Aruba",
                "common": "Aruba"
            },
            "pap": {
                "official": "Aruba",
                "common": "Aruba"
            }
        }
    },
    "tld": [
        ".aw"
    ],
    "cca2": "AW",
    "ccn3": "533",
    "cca3": "ABW",
    "cioc": "ARU",
    "independent": false,
    "status": "officially-assigned",
    "unMember": false,
    "currencies": {
        "AWG": {
            "name": "Aruban florin",
            "symbol": "u0192"
        }
    },
    "idd": {
        "root": "+2",
        "suffixes": [
            "97"
        ]
    },
    "capital": [
        "Oranjestad"
    ],
    "altSpellings": [
        "AW"
    ],
    "region": "Americas",
    "subregion": "Caribbean",
    "languages": {
        "nld": "Dutch",
        "pap": "Papiamento"
    },
    "translations": {
        "ces": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "deu": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "est": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "fin": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "fra": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "hrv": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "hun": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "ita": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "jpn": {
            "official": "u30a2u30ebu30d0",
            "common": "u30a2u30ebu30d0"
        },
        "kor": {
            "official": "uc544ub8e8ubc14",
            "common": "uc544ub8e8ubc14"
        },
        "nld": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "per": {
            "official": "u0622u0631u0648u0628u0627",
            "common": "u0622u0631u0648u0628u0627"
        },
        "pol": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "por": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "rus": {
            "official": "u0410u0440u0443u0431u0430",
            "common": "u0410u0440u0443u0431u0430"
        },
        "slk": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "spa": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "swe": {
            "official": "Aruba",
            "common": "Aruba"
        },
        "urd": {
            "official": "u0627u0631u0648u0628u0627",
            "common": "u0627u0631u0648u0628u0627"
        },
        "zho": {
            "official": "u963fu9c81u5df4",
            "common": "u963fu9c81u5df4"
        }
    },
    
{
    "name": {
        "common": "Afghanistan",
        "official": "Islamic Republic of Afghanistan",
        "native": {
            "prs": {
                "official": "u062cu0645u0647u0648u0631u06cc u0627u0633u0644u0627u0645u06cc u0627u0641u063au0627u0646u0633u062au0627u0646",
                "common": "u0627u0641u063au0627u0646u0633u062au0627u0646"
            },
            "pus": {
                "official": "u062f u0627u0641u063au0627u0646u0633u062au0627u0646 u0627u0633u0644u0627u0645u064a u062cu0645u0647u0648u0631u06ccu062a",
                "common": "u0627u0641u063au0627u0646u0633u062au0627u0646"
            },
            "tuk": {
                "official": "Owganystan Yslam Respublikasy",
                "common": "Owganystan"
            }
        }
    },
    "tld": [
        ".af"
    ],
    "cca2": "AF",
    "ccn3": "004",
    "cca3": "AFG",
    "cioc": "AFG",
    "independent": true,
    "status": "officially-assigned",
    "unMember": true,
    "currencies": {
        "AFN": {
            "name": "Afghan afghani",
            "symbol": "u060b"
        }
    },
    "idd": {
        "root": "+9",
        "suffixes": [
            "3"
        ]
    },
    "capital": [
        "Kabul"
    ],
    "altSpellings": [
        "AF",
        "Afu0121u0101nistu0101n"
    ],
    "region": "Asia",
    "subregion": "Southern Asia",
    "languages": {
        "prs": "Dari",
        "pus": "Pashto",
        "tuk": "Turkmen"
    },
    "translations": {
        "ces": {
            "official": "Afghu00e1nsku00e1 islu00e1msku00e1 republika",
            "common": "Afghu00e1nistu00e1n"
        },
        "cym": {
            "official": "Gweriniaeth Islamaidd Affganistan",
            "common": "Affganistan"
        },
        "deu": {
            "official": "Islamische Republik Afghanistan",
            "common": "Afghanistan"
        },
        "est": {
            "official": "Afganistani Islamivabariik",
            "common": "Afganistan"
        },
        "fin": {
            "official": "Afganistanin islamilainen tasavalta",
            "common": "Afganistan"
        },
        "fra": {
            "official": "Ru00e9publique islamique d'Afghanistan",
            "common": "Afghanistan"
        },
        "hrv": {
            "official": "Islamska Republika Afganistan",
            "common": "Afganistan"
        },
        "hun": {
            "official": "Afganisztu00e1ni Iszlu00e1m Ku00f6ztu00e1rsasu00e1g",
            "common": "Afganisztu00e1n"
        },
        "ita": {
            "official": "Repubblica islamica dell'Afghanistan",
            "common": "Afghanistan"
        },
        "jpn": {
            "official": "u30a2u30d5u30acu30cbu30b9u30bfu30f3u00b7u30a4u30b9u30e9u30e0u5171u548cu56fd",
            "common": "u30a2u30d5u30acu30cbu30b9u30bfu30f3"
        },
        "kor": {
            "official": "uc544ud504uac00ub2c8uc2a4ud0c4 uc774uc2acub78c uacf5ud654uad6d",
            "common": "uc544ud504uac00ub2c8uc2a4ud0c4"
        },
        "nld": {
            "official": "Islamitische Republiek Afghanistan",
            "common": "Afghanistan"
        },
        "per": {
            "official": "u062cu0645u0647u0648u0631u06cc u0627u0633u0644u0627u0645u06cc u0627u0641u063au0627u0646u0633u062au0627u0646",
            "common": "u0627u0641u063au0627u0646u0633u062au0627u0646"
        },
        "pol": {
            "official": "Islamska Republika Afganistanu",
            "common": "Afganistan"
        },
        "por": {
            "official": "Repu00fablica Islu00e2mica do Afeganistu00e3o",
            "common": "Afeganistu00e3o"
        },
        "rus": {
            "official": "u0418u0441u043bu0430u043cu0441u043au0430u044f u0420u0435u0441u043fu0443u0431u043bu0438u043au0430 u0410u0444u0433u0430u043du0438u0441u0442u0430u043d",
            "common": "u0410u0444u0433u0430u043du0438u0441u0442u0430u043d"
        },
        "slk": {
            "official": "Afgu00e1nsky islamsku00fd u0161tu00e1t",
            "common": "Afganistan"
        },
        "spa": {
            "official": "Repu00fablica Islu00e1mica de Afganistu00e1n",
            "common": "Afganistu00e1n"
        },
        "swe": {
            "official": "Islamiska republiken Afghanistan",
            "common": "Afghanistan"
        },
        "urd": {
            "official": "u0627u0633u0644u0627u0645u06cc u062cu0645u06c1u0648u0631u06ccu06c1 u0627u0641u063au0627u0646u0633u062au0627u0646",
            "common": "u0627u0641u063au0627u0646u0633u062au0627u0646"
        },
        "zho": {
            "official": "u963fu5bccu6c57u4f0au65afu5170u5171u548cu56fd",
            "common": "u963fu5bccu6c57"
        }
    },
    "latlng": [
        33,
        65
    ],
    "landlocked": true,
    "borders": [
        "IRN",
        "PAK",
        "TKM",
        "UZB",
        "TJK",
        "CHN"
    ],
    "area": 652230,
    "flag": "ud83cudde6ud83cuddeb"
    
}]

I access it through Javascipt code const data = require('./countries.json');. What I need from this .json file is translation keys, for example ces, deu, etc. I need to retrieve them dynamically and store in the array called keys. After that, depending on user’s input, if input is equal to one of the keys from an array it should print official name of all countries using this key.
In my Javascript code I use following methods to do so:

const data = require('./countries.json');
const keys = [];
data.forEach((element) => {
Object.keys(element.translations).forEach((item) => {
keys.push(item);
}) ;
});

/**
*Removes all duplicate translation keys
*@param {1} keys of translation keys
*@return {unique} a unique array of translation keys
*/
function removeDuplicates (keys) { 
const unique = [];
      keys.forEach((element) => {
if (!unique.includes(element)) {
  unique.push(element);
}
});
return unique;
}
const enteredKey = process.argv.slice(2);
console.log('Key is : ', enteredKey);

if (enteredKey.length < 2 && enteredKey !== null && removeDuplicates(keys).includes(enteredKey[0])) {
try {
for (const {translations} of data) {
  const key = translations[enteredKey]?.official;
  if (key) {
    console.log(key);
  }
 }
}

Please note that I am using const key = translations[enteredKey]?.official; because there are a lot of countries and few of them do not have some keys, like cym key is appear in only half of the countries. Without [enteredKey]?.official program will crush because it won’t be able to find this key and define it.

Now I need to the same, but with python3. I have tried :

f = open('./countries.json')
translationKeys = json.load(f)
keys = []
for i in translationKeys[0]["translations"]:
keys.append(i)
print(keys)
f.close()

but the output was really messy:

['ces']
['ces', 'deu']
['ces', 'deu', 'est']
['ces', 'deu', 'est', 'fin']

Since I am not familiar with python at all, I am curious how to retrieve and store these keys the same way I did that in Javascript and print value of these keys depend on user’s input.
I will leave a github link for those who wish to see entire project to get more context if needed: https://github.com/TheRadioDept/technical-question