我试图理解在Python的上下文中,'implicit'和'explicit'的真正含义。
a = []
# my understanding is that this is implicit
if not a:
print("list is empty")
# my understanding is that this is explicit
if len(a) == 0:
print("list is empty")
我试图遵循Python之禅的规则,但是我想知道这是否适用于这种情况,或者是否我考虑过度了?
a
?为什么是list
?打错了吗? - Mad Physicist