For example, if passed the following:
(例如,如果通过以下内容:)
a = []
How do I check to see if a is empty?
a
(如何检查a是否为空?)
if not a: print("List is empty")
Using the implicit booleanness of the empty list is quite pythonic.
list
(使用空list的隐式布尔值是非常Python的。)
1.4m articles
1.4m replys
5 comments
57.0k users