相关疑难解决方法(0)

在dicts的词典中,你如何模仿Perl的自动生存行为?

谷歌和在线文档都没有提供我的查询的很多见解,所以我想我会在这里问社区.

在Perl中,您可以轻松设置哈希哈希哈希值并测试最终密钥,如下所示:

my $hash = {};
$hash{"element1"}{"sub1"}{"subsub1"} = "value1";
if (exists($hash{"element1"}{"sub1"}{"subsub1"})) {
   print "found value\n";
}
Run Code Online (Sandbox Code Playgroud)

什么是Python中的"最佳实践"等价物?

python dictionary autovivification

13
推荐指数
2
解决办法
3296
查看次数

标签 统计

autovivification ×1

dictionary ×1

python ×1