小编Sam*_*nks的帖子

将字符串转换为int Python 3的简短方法

所以在我的代码中我通常这样做将字符串转换为int,但我想知道是否有一种不那么笨拙的方式,因为它感觉有点长.

my_input = int(my_input)
Run Code Online (Sandbox Code Playgroud)

也许这就是它必须如何,但如果你有任何想法,请提前感谢.

python type-conversion python-3.x

17
推荐指数
2
解决办法
8万
查看次数

标签 统计

python ×1

python-3.x ×1

type-conversion ×1