python - Python逻辑`and`返回错误结果比较列表
问题描述
y1 = [True, True, False, False]
y2 = [False, True, True, False]
y3 = y1 and y2
print(y3)
>>> [False, True, True, False]
这里发生了什么?操作中的第三项是False
andTrue
这会导致True
?
解决方案
推荐阅读
- javascript - electron :在托盘应用程序中显示基本通知
- r - For 循环,包括“if”和“while”,运行数小时
- elasticsearch - 使用两个过滤器,字段的值和时间戳在 kibana 中的字符串字段上创建 URL
- regex - 如何匹配以 2 位数字结尾的 10 字符字符串?
- jquery - 使用 jquery 从复选框形成 API 调用请求
- javascript - 对象的属性未定义,即使对象上的 console.log 显示属性值
- javascript - 如何在某些部分隐藏/显示固定元素?
- ruby-on-rails - 葡萄如何动态设置参数值
- xpages - 将多个 NotesRichText 字段附加到文件下载控件
- java - 如何在eclipse`中做项目结构“src/main/java”?