s1='128'
f1=98.7
s2='76.77'
ff=True
s3='hello'
print(type(s1),type(f1),type(s2),type(ff),type(s3)) #'str' 'float' 'str' 'bool' 'str'
print(int(s1),type(int(s1))) #128 'int'
print(int(f1),type(int(f1))) #98 'int'
print(int(s2),type(int(s2))) #将str转成int类型报错,因不字符串为小数串
print(int(ff),type(int(ff))) #1 'int'
print(int(s3),type(int(s3))) #将str转成int类型时,字符串必须为数字串(整数),非数字串是不允许转换