Python 内建函数
将数字 3.5 转换为整数:
x = int(3.14)
运行实例
int() 函数将指定值转换为整数。
int(value, base)
将字符串转换为整数:
x = int("15")