python进阶
5、and 和 orand返回第一个假值,如果都为真,返回最后一个真值。or返回第一个真值,如果都为假,返回最后一个假值。复制代码>>> a = "first">>> b = "second">>> 1 and a or b 1'first'>>> 0 and a or b 2'second'复制代码类似于: bool ? a : b安全使用:>>> a = "">>> b = "second">>> (1 and [a] or [b])[0] 1
python http服务器 :
https://blog.csdn.net/mrbcy/article/details/72630201
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。