📜  如何将字符串转换为 int python 代码示例

📅  最后修改于: 2022-03-11 14:47:16.698000             🧑  作者: Mango

代码示例1
#The string
number_string = input('Type a number')
result = int(number_string) + 2
print(int(result))