pythonic的方法来自PEP 8样式指南(“是”表示“推荐”,“ 否”表示“不推荐”):
对于序列(字符串,列表,元组),请使用以下事实:空序列为假。
Yes: if not seq: if seq:No: if len(seq): if not len(seq):

pythonic的方法来自PEP 8样式指南(“是”表示“推荐”,“ 否”表示“不推荐”):
对于序列(字符串,列表,元组),请使用以下事实:空序列为假。
Yes: if not seq: if seq:No: if len(seq): if not len(seq):