python基础一 day2 数据类型

int:

      

bool:

  类型转换:

       str到int有条件,str必须是数字, "123e"是错误的

bool转换为int类型,需要int(x)

 结果: 

结果:

扫描二维码关注公众号,回复: 6305122 查看本文章

空字符串不要加空格,

       

ValueError:语法错误

猜你喜欢

转载自www.cnblogs.com/wang-tan/p/10947248.html