python判斷字符串或者集合是否爲空

最近在看《Effective Python》,裏面提到判斷字符串或者集合是否爲空的原則,原文以下:python Don’t check for empty values (like [] or '') by checking the length (if len(somelist) == 0). Use if not somelist and assume empty values implici
相關文章
相關標籤/搜索