課程
/后端開發(fā)
/Python
/初識(shí)Python
為什么我在命令提示符里面輸入?print 'hello,' or a or 0 輸出的是hello,print 'hello,' or a and 0 出來(lái)是hello(不該是0嗎?)
2016-07-04
源自:初識(shí)Python 3-9
正在回答
按照從優(yōu)先級(jí)最高到最低的順序,布爾運(yùn)算符有:Not、And、Or、Xor、Eqv 和 Imp。
print 'hello,' or a and 0
1. a and 0??--> 0 ?
2. 'hello,'?or 0 ?--> 'hello,'?? ?
weibo_喵喵喵喵喵到底有多少_03593603 提問(wèn)者
街頭霸王洗髮水 回復(fù) weibo_喵喵喵喵喵到底有多少_03593603 提問(wèn)者
0 false
舉報(bào)
學(xué)python入門視頻教程,讓你快速入門并能編寫簡(jiǎn)單的Python程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-07-05
按照從優(yōu)先級(jí)最高到最低的順序,布爾運(yùn)算符有:Not、And、Or、Xor、Eqv 和 Imp。
print 'hello,' or a and 0
1. a and 0??--> 0 ?
2. 'hello,'?or 0 ?--> 'hello,'?? ?
2016-07-05
0 false