作者:拍友2702932701 | 来源:互联网 | 2023-09-17 12:02
翻译自:https:stackoverflow.comquestions53513best-way-to-check-if-a-list-is-empty一个比较pythonic
翻译自: https://stackoverflow.com/questions/53513/best-way-to-check-if-a-list-is-empty
一个比较pythonic的做法:
if not list1:
print("List is empty")