內(nèi)嵌類(lèi)型與它們的布爾解釋?xiě)?yīng)用在python中
提問(wèn)人:楊紫紅發(fā)布時(shí)間:2020-11-18
所有內(nèi)嵌類(lèi)型可以直接在'if' 命令中使用
數(shù)字0對(duì)應(yīng) False
其他數(shù)都對(duì)應(yīng) True
空對(duì)象 (str, list, dict) 對(duì)應(yīng) False
其它有值的對(duì)象對(duì)應(yīng) True
使用函數(shù) 'bool' 來(lái)獲取顯示的值

繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>