python - 为什么我的 Python 代码会这样打印?
问题描述
我输入了传递的 int 值并尝试对其进行布尔运算,但我无法理解为什么它会给出这种输出。
x = int(input())
y = int(input())
print(x and y)
print(x or y)
上述代码的输出:
12
13
13
12
解决方案
推荐阅读
- javascript - 构建项目后“onClick”不起作用
- jquery - 将jquery datepicker的位置更改为顶部
- python - 两个百分比的概率或机会
- javascript - 在音频文件语音到文本 microsoft sdk 中的一段不说话后保持单词偏移
- python - 如果路径有空格,Python检查2个字符串是否代表相同的路径
- c - C 严格别名是否使无类型静态内存池成为不可能?
- javascript - 为什么关键字“this”会在一个函数中被识别,而在同一个 Backbone 视图中却不能识别?
- python - 使用 gmail 时出错,帐户超出带宽
- c# - wsdl 服务中的可选属性
- three.js - Animated text ribbons in Three.js