更新时间:2023-02-17 13:51:42
错误是基于10的int()的无效文字:。这只是意味着您传递给 int
的参数看起来不像数字。换句话说,它是空的,或者除了数字之外还有一个字符。
The error is "invalid literal for int() with base 10:". This just means that the argument that you passed to int
doesn't look like a number. In other words it's either empty, or has a character in it other than a digit.
这可以在python shell中重现。
This can be reproduced in a python shell.
>>> int("x")
ValueError: invalid literal for int() with base 10: 'x'