方法一:
list_temp = []
if len(list_temp):
# 存在值即为真
else:
# list_temp是空的
方法二:
list_temp = []
if list_temp:
# 存在值即为真
else:
# list_temp是空的
猜你喜欢:👇🏻
⭐【Python】反转列表 list 的几种方法
⭐【Python】列表 list 添加元素的几种方法
⭐【Python】一种超简单的二维列表降维方法
方法一:
list_temp = []
if len(list_temp):
# 存在值即为真
else:
# list_temp是空的
方法二:
list_temp = []
if list_temp:
# 存在值即为真
else:
# list_temp是空的
猜你喜欢:👇🏻
⭐【Python】反转列表 list 的几种方法
⭐【Python】列表 list 添加元素的几种方法
⭐【Python】一种超简单的二维列表降维方法