Python基础:int()函数
https://www.runoob.com/python/python-func-int.html
int() 方法的语法:
class int(x, base=10)
x -- 字符串或数字。
base -- 进制数,默认十进制。
错误示例
int("92",8)
异常类型:ValueError
异常原因:92不是一个八进制数(9超出范围)
https://www.runoob.com/python/python-func-int.html
class int(x, base=10)
x -- 字符串或数字。
base -- 进制数,默认十进制。
int("92",8)
异常类型:ValueError
异常原因:92不是一个八进制数(9超出范围)