报错记录: invalid literal for int() with base 10: '3.0'

  • 如图,由于用户输入会自动转换为str类型,若对输入的数字进行相加,需要进行类型转换

  • 但是int()只能转化由纯数字组成的字符串

猜你喜欢

转载自www.cnblogs.com/wxy2000/p/11964147.html