2019-04-01
阅读量:
888
python中all函数
问题描述:
python中all函数的用法
解决方法:
如果可迭代的对象(数组,字符串,列表等,下同)中的元素都是 true (或者为空)的话返回 True 。
_all = True
for item in iterable:
if not item:
_all = False
break
if _all:
# do stuff






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论