python基础一 day2 数据类型

int:

      

bool:

  类型转换:

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

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

 结果: 

结果:

空字符串不要加空格,

       

ValueError:语法错误

原文地址:https://www.cnblogs.com/wang-tan/p/10947248.html