您的位置:首页 > 编程语言 > Python开发

Python and-or例子说明

2016-07-29 16:21 417 查看
d = ""
e = "hell"
f = (False and [d] or [e])
print f #['hell']

d = ""
e = "hell"
f = (False and [d] or [e])[0]
print f #hell

d = ""
e = "hell"
f = (True and [d] or [e])[0]
print f #空白

d = ""
e = "hell"
f = (True and [d] or [e])
print f #['']
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python and-or