有没有一种简单的方法可以使用嵌套字典条目并确保没有任何键丢失?

2024-05-19 07:57:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用更少的代码执行以下操作:

if "address" in structured_data:
    if "addressCountry" in structured_data["address"]:
        data["country"] = structured_data["address"]["addressCountry"]

这可能吗


Tags: indataifaddresscountry代码执行structuredaddresscountry

热门问题