<分区>
Google 和在线文档都没有对我的查询提供太多见解,所以我想我会在这里问社区。p>
在 Perl 中,您可以轻松地设置一个哈希的哈希并像这样测试最终的 key :
my $hash = {};
$hash{"element1"}{"sub1"}{"subsub1"} = "value1";
if (exists($hash{"element1"}{"sub1"}{"subsub1"})) {
print "found value\n";
}
Python 中的“最佳实践”是什么?