37,719
社区成员
发帖
与我相关
我的任务
分享
>>> int (12,16)
Traceback (most recent call last):
File "<pyshell#41>", line 1, in <module>
int (12,16)
TypeError: int() can't convert non-string with explicit base
>>> help(int)
class int(object)
| int(x[, base]) -> integer
|
| Convert a string or number to an integer, if possible. A floating point
| argument will be truncated towards zero (this does not include a string
| representation of a floating point number!) When converting a string, use
| the optional base. It is an error to supply a base when converting a
| non-string. If the argument is outside the integer range a long object
| will be returned instead.
>>> int ('12', 16)
18
>>>