【发布时间】:2015-04-09 23:58:31
【问题描述】:
如果布尔值列表为真,我正在尝试运行一些函数。 我的列表由布尔函数组成。
list = [file.endswith('05',21,22), file.endswith('11',21,22),
file.endswith('17',21,22), file.endswith('21',21,22),
file.endswith('23',21,22)]
if any(True in list) == True:
# do something
目前,if 子句给我一个错误
if any(True in list) == True:
TypeError: 'bool' object is not iterable
不确定如何解决。
【问题讨论】:
-
不要隐藏内置的
list。
标签: python string list boolean