課程
/后端開發
/Python
/Python3 入門教程(新版)
請問下True and 0的計算結果可以是False嗎?以及0 or 99的計算結果可以寫作True嗎?
2021-11-17
源自:Python3 入門教程(新版) 3-4
正在回答
0相當于空字符串所以當作false,所以true and 0 是false ,相反0 or 99? 輸出的是99
舉報
python3入門教程,讓你快速入門并能編寫簡單的Python程序
2 回答True and 0 or 99
3 回答True and 0,不就等于 True and False ,那么結果不應該是 False 么
1 回答a = True print(a and 0 or 99) # ==> 99
3 回答與運算99 and 98什么結果
1 回答請綜合使用while True和break,計算0~1000以內,所有偶數的和。為什么這樣不對
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2021-11-17
0相當于空字符串所以當作false,所以true and 0 是false ,相反0 or 99? 輸出的是99