会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
奔奔-武
博客园
首页
新随笔
联系
管理
订阅
2020年6月10日
python基础:int、str和bool类型之间的转换
摘要: int类型转换为bool类型时,0为False,非0为True str类型转换为bool类型时,空字符串和None为False,不空为True 以下为代码示例: 1 # int转换为bool 2 # 0是False 3 print(bool(0)) 4 # 非0是True 5 print(bool(
阅读全文
posted @ 2020-06-10 11:36 奔奔-武
阅读(13338)
评论(0)
推荐(0)
编辑
公告