23-难度5:or/and 的返回值再转 bool
语法讲解
今天学: 短路返回值 + bool()
a = 0
b = 5
c = ""
print(bool(a or b))
print(bool(a and b and c))
小练习
运行下面代码后输出是什么?(多行输出请按真实换行提交)
a = 0
b = 5
c = ""
print(bool(a or b))
print(bool(a and b and c))
提交要求: 只提交最终输出结果,不要添加多余的说明或引号。
全部评论