python int(input())

x = int(input())是把输入的x的值用int()转换成整数形式为什么出错了呢?

int(2.11) = 2
int('2.11') 是会报错的。
只能写 int(float('2.11'))
温馨提示:答案为网友推荐,仅供参考
相似回答