刚学python出现个小问题:invalid literal for int() with base 10:

a=int(input())
输入12.3
报错,请问问题出在哪里?

第1个回答  2014-08-09

python2.7 测试无误,没错。

本回答被提问者采纳
第2个回答  2014-08-09
int是整数型,float才是小数型
第3个回答  2019-12-21
int表示整形 你应该输入整数
相似回答